From 4e7434ff028c4280bed620f28fdbf9f4d77d77ce Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 2 Nov 2007 21:53:00 -0400 Subject: 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" Signed-off-by: Sam Ravnborg --- scripts/setlocalversion | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/setlocalversion') diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 1b31da843672..acce8ebc5d40 100644 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -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 -- cgit v1.2.3-59-g8ed1b