Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-27 06:49:01 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-27 06:49:01 +0400
commit2fe18392f0355c80295b8b74b24fc817183d3752 (patch)
tree46feb2f65ad4589475ff946bb34b8abd4a5a928d /builtin-show-branch.c
parent2d3cfd77ad5305c132f7b23c192ae6c327443c95 (diff)
parent109440c1bf2a3015cd9253515f07231c4cf9d65a (diff)
Merge branch 'maint'
* maint: Documentation: fix graph in git-rev-parse.txt show-branch --current: do not barf on detached HEAD
Diffstat (limited to 'builtin-show-branch.c')
-rw-r--r--builtin-show-branch.c4
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);
}
}