OSDN Git Service

GIT-VERSION-GEN: mark the version 'dirty' only if there are modified files
authorJunio C Hamano <gitster@pobox.com>
Fri, 8 Aug 2008 20:31:27 +0000 (13:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Aug 2008 20:31:27 +0000 (13:31 -0700)
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>
GIT-VERSION-GEN

index cb7cd4b..e1290d8 100755 (executable)
@@ -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