Skip to content

Commit

Permalink
GIT-VERSION-GEN: mark the version 'dirty' only if there are modified …
Browse files Browse the repository at this point in the history
…files

We used to mark the version string with '-dirty' if the cache was not up
to date, but the only thing we want to know is if the binaries are built
from modified source.  Refresh the cache to avoid false dirtyness.

Christian Jaeger noticed this issue while building under fakeroot
environment (without -u) that lies about the file ownership data.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Aug 8, 2008
1 parent c94c8e5 commit b13d440
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ elif test -d .git -o -f .git &&
case "$VN" in
*$LF*) (exit 1) ;;
v[0-9]*)
git update-index -q --refresh
test -z "$(git diff-index --name-only HEAD --)" ||
VN="$VN-dirty" ;;
esac
Expand Down

0 comments on commit b13d440

Please sign in to comment.