merge script: notice @{-1} shorthand
[gitweb.git] / contrib / examples / git-merge.sh
index 5a2addd4e15da9f8204aae5f4bbdffd296b9c0f9..bed55a48dfbbea5055a2bb5cbe3436feb5c4458f 100755 (executable)
@@ -148,13 +148,15 @@ merge_name () {
        if found_ref=$(git rev-parse --symbolic-full-name --verify \
                                                        "$remote" 2>/dev/null)
        then
+               expanded=$(git check-ref-format --branch "$remote") ||
+                       exit
                if test "${found_ref#refs/heads/}" != "$found_ref"
                then
-                       echo "$rh               branch '$remote' of ."
+                       echo "$rh               branch '$expanded' of ."
                        return
                elif test "${found_ref#refs/remotes/}" != "$found_ref"
                then
-                       echo "$rh               remote branch '$remote' of ."
+                       echo "$rh               remote branch '$expanded' of ."
                        return
                fi
        fi