[PATCH 32/77] kbuild: fix scripts/setlocalversion to avoid erroneous -dirty tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Theodore Ts'o <tytso@xxxxxxx>

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" <tytso@xxxxxxx>
Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
---
 scripts/setlocalversion |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 1b31da8..acce8eb 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
-- 
1.5.4.rc3.14.g44397

-
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux