File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -eu
4
4
5
- if ! git diff-index --quiet HEAD -- {tsx,typescript}/src/; then
6
- cat 1>&2 << EOF
7
- Generated files in the working tree are inconsistent with HEAD.
8
- Make sure to commit generated files in {tsx,typescript}/src/ when the grammar changes.
9
- EOF
5
+ # # Update index to make sure the subsequent diff-index command only reports
6
+ # # a change if the file content actually changed. Not updating the index can
7
+ # # give incorrect results when this script is run right after a build.
8
+
9
+ git update-index -q --really-refresh
10
+
11
+ if ! git diff-index --exit-code --name-status HEAD -- {tsx,typescript}/src/; then
12
+ echo " The following files are not up to date in the repository:" 1>&2
13
+ git diff-index --name-status HEAD 1>&2
14
+ echo " Run a build and commit the generated files to resolve this issue." 1>&2
15
+ git diff-index -p HEAD
10
16
exit 1
11
17
fi
12
18
You can’t perform that action at this time.
0 commit comments