Skip to content

Commit

Permalink
Teach GIT-VERSION-GEN about the .git file
Browse files Browse the repository at this point in the history
The presence of a .git directory used to be good enough evidence that
GIT-VERSION-GEN could use 'git describe' to get a version number. But
now .git might as well be a file so the test must be extended to cater for
such setups.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Lars Hjemli authored and Junio C Hamano committed Apr 9, 2008
1 parent ba88a1f commit c48799e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LF='
if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
elif test -d .git &&
elif test -d .git -o -f .git &&
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
case "$VN" in
*$LF*) (exit 1) ;;
Expand Down

0 comments on commit c48799e

Please sign in to comment.