]> asedeno.scripts.mit.edu Git - git.git/commitdiff
git-submodule: Avoid 'fatal: cannot describe' message
authorPing Yin <pkufranky@gmail.com>
Thu, 10 Apr 2008 14:45:29 +0000 (22:45 +0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 12 Apr 2008 00:35:39 +0000 (17:35 -0700)
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 <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh

index 56ec3536e0c40190329b9867b46e36753f30efb2..7674346c8d9525b0d8928f48354bdbe0af8b8e23 100755 (executable)
@@ -327,7 +327,7 @@ set_name_rev () {
                cd "$1" && {
                        git describe "$2" 2>/dev/null ||
                        git describe --tags "$2" 2>/dev/null ||
-                       git describe --contains --tags "$2"
+                       git describe --contains --tags --always "$2"
                }
        ) )
        test -z "$revname" || revname=" ($revname)"