@matheusbsbs / matheus-bagliano / commits / b13d44093b
Fork 0

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>

Junio C Hamano committed Aug 8, 2008 at 13:31 UTC b13d44093bac2eb75f37be01f0e369290211472c
1 file changed +1
GIT-VERSION-GEN
+1
@@ -16,6 +16,7 @@ elif test -d .git -o -f .git &&
16 case "$VN" in
17 *$LF*) (exit 1) ;;
18 v[0-9]*)
19 + git update-index -q --refresh
20 test -z "$(git diff-index --name-only HEAD --)" ||
21 VN="$VN-dirty" ;;
22 esac