]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-show-branch.c
git-svn: add ability to specify --commit-url for dcommit
[thirdparty/git.git] / builtin-show-branch.c
index ee4269dd33aa0b2229eaac0ce7b75f7893447b0f..233eed499d0b8790781326ff0455bdc7f09fe4d4 100644 (file)
@@ -4,7 +4,7 @@
 #include "builtin.h"
 
 static const char show_branch_usage[] =
-"git-show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n[,b]] <branch>";
+"git show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...] | --reflog[=n[,b]] <branch>";
 static const char show_branch_usage_reflog[] =
 "--reflog is incompatible with --all, --remotes, --independent or --merge-base";
 
@@ -782,8 +782,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                                has_head++;
                }
                if (!has_head) {
-                       int pfxlen = strlen("refs/heads/");
-                       append_one_rev(head + pfxlen);
+                       int offset = !prefixcmp(head, "refs/heads/") ? 11 : 0;
+                       append_one_rev(head + offset);
                }
        }