kbuild: fix scripts/setlocalversion to avoid erroneous -dirty tag

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.

Signed-off-by: "Theodore Ts'o" <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
This commit is contained in:
Theodore Ts'o authored and Sam Ravnborg committed 2008-01-28 23:14:37 +01:00
1 parent d882421f4e
commit 4e7434ff02
1 file changed
+1
+1
View File
@@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
fi
# Are there uncommitted changes?
git update-index --refresh --unmerged > /dev/null
if git diff-index HEAD | read dummy; then
printf '%s' -dirty
fi