X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-show-branch.c;h=93047f5117796fb7556fa23871397e68e9f5e4c2;hb=4df0d7af6be27fe5b0ffef438ef0169607253f66;hp=ee4269dd33aa0b2229eaac0ce7b75f7893447b0f;hpb=9bd81e4249a419f9cde8fd68e033e263533f4914;p=git.git diff --git a/builtin-show-branch.c b/builtin-show-branch.c index ee4269dd3..93047f511 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -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); } }