If git's index file is out of date, and some files have been touched such that their timestamp doesn't what is in the index, "git diff-index HEAD" may show that a particular file is dirty, when in fact it really isn't. Running "git update-index" will update the index to avoid these false positives.
Showing the changes to scripts/setlocalversion (1 of 1 file). Show all
Unified · Split
| @@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then · 15 unmodified lines | ||
| 16 | 16 | fi |
| 17 | 17 | |
| 18 | 18 | # Are there uncommitted changes? |
| 19 | + git update-index --refresh --unmerged > /dev/null | |
| 19 | 20 | if git diff-index HEAD | read dummy; then |
| 20 | 21 | printf '%s' -dirty |
| 21 | 22 | fi |