Code

builtin-fetch.c (store_updated_refs): Honor update_local_ref() return value
[git.git] / builtin-show-branch.c
index ee4269dd33aa0b2229eaac0ce7b75f7893447b0f..93047f5117796fb7556fa23871397e68e9f5e4c2 100644 (file)
@@ -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);
                }
        }