X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-show-branch.c;h=233eed499d0b8790781326ff0455bdc7f09fe4d4;hb=5fc3e67ac0241c491dcf1c0c9dcd4a4d83e7c243;hp=ee4269dd33aa0b2229eaac0ce7b75f7893447b0f;hpb=ef90d6d4208a5130185b04f06e5f90a5f9959fe3;p=git.git diff --git a/builtin-show-branch.c b/builtin-show-branch.c index ee4269dd3..233eed499 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -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] [...] | --reflog[=n[,b]] "; +"git show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [...] | --reflog[=n[,b]] "; 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); } }