Skip to content

Commit a68972c

Browse files
pkufrankygitster
authored andcommitted
git-submodule: Avoid 'fatal: cannot describe' message
When "git submodule status" command tries to show the name of the submodule HEAD revision more descriptively, but the submodule repository lacked a suitable tag to do so, it leaked "fatal: cannot describe" message to the UI. Squelch it by using '--always'. Signed-off-by: Ping Yin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6309ac commit a68972c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ set_name_rev () {
327327
cd "$1" && {
328328
git describe "$2" 2>/dev/null ||
329329
git describe --tags "$2" 2>/dev/null ||
330-
git describe --contains --tags "$2"
330+
git describe --contains --tags --always "$2"
331331
}
332332
) )
333333
test -z "$revname" || revname=" ($revname)"

0 commit comments

Comments
 (0)