diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-08 13:31:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-08 13:31:27 -0700 |
commit | b13d44093bac2eb75f37be01f0e369290211472c (patch) | |
tree | f175f8bf3937eae7d43678aaff772d11afa9d60c /GIT-VERSION-GEN | |
parent | Makefile: set SHELL to value of SHELL_PATH (diff) | |
download | tgif-b13d44093bac2eb75f37be01f0e369290211472c.tar.xz |
GIT-VERSION-GEN: mark the version 'dirty' only if there are modified 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>
Diffstat (limited to 'GIT-VERSION-GEN')
-rwxr-xr-x | GIT-VERSION-GEN | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index cb7cd4b538..e1290d8901 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -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 |