File: files-changed

package info (click to toggle)
fscrypt 0.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,064 kB
  • sloc: sh: 970; makefile: 159; ansic: 84
file content (25 lines) | stat: -rwxr-xr-x 747 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Detect if any files have changed in the git repository. Output an appropriate
# error message if they have changed.

if [[ -n $(git status -s) ]]; then
  git diff --minimal HEAD
  echo
  echo "**************************************************"
  case "$1" in
  "proto")
    echo "* .pb.go files and .proto files are out of sync. *"
    echo "*        Run \"make gen\" to generate them.        *"
    ;;
  "format")
    echo "*    C or Go files have incorrect formatting.    *"
    echo "*         Run \"make format\" to fix them.         *"
    ;;
  *)
    echo "*     Files have changed in this repository.     *"
    ;;
  esac
  echo "**************************************************"
  git reset HEAD --hard
  exit 1
fi