Skip to content

Commit 4e7434f

Browse files
tytsosravnborg
authored andcommitted
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" <tytso@mit.edu> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
1 parent d882421 commit 4e7434f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎scripts/setlocalversion‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
1616
fi
1717

1818
# Are there uncommitted changes?
19+
git update-index --refresh --unmerged > /dev/null
1920
if git diff-index HEAD | read dummy; then
2021
printf '%s' -dirty
2122
fi

0 commit comments

Comments
 (0)