diff options
Diffstat (limited to 'builtin-show-branch.c')
-rw-r--r-- | builtin-show-branch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-show-branch.c b/builtin-show-branch.c index ee4269dd33..93047f5117 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); } } |