Skip to content

Commit c48799e

Browse files
hjemligitster
authored andcommitted
Teach GIT-VERSION-GEN about the .git file
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ba88a1f commit c48799e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LF='
1111
if test -f version
1212
then
1313
VN=$(cat version) || VN="$DEF_VER"
14-
elif test -d .git &&
14+
elif test -d .git -o -f .git &&
1515
VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
1616
case "$VN" in
1717
*$LF*) (exit 1) ;;

0 commit comments

Comments
 (0)