Skip to content

Commit

Permalink
kbuild: fix scripts/setlocalversion to avoid erroneous -dirty tag
Browse files Browse the repository at this point in the history
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@mit.edu>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Theodore Ts'o authored and Sam Ravnborg committed Jan 28, 2008
1 parent d882421 commit 4e7434f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e7434f

Please sign in to comment.