summaryrefslogtreecommitdiff
path: root/builtin-show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-04 07:31:47 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-04 07:34:22 (GMT)
commit632ac9fd12a2d4ff2c1a1fcd63492ce24315221f (patch)
tree54f5a53cc156c661fdf5202a4419fbc97cab8f3d /builtin-show-branch.c
parentdc9195ac7830bdf08ee847ef6a385c0b8f673d69 (diff)
downloadgit-632ac9fd12a2d4ff2c1a1fcd63492ce24315221f.zip
git-632ac9fd12a2d4ff2c1a1fcd63492ce24315221f.tar.gz
git-632ac9fd12a2d4ff2c1a1fcd63492ce24315221f.tar.bz2
show-branch -g: default to the current branch.
Now we have a separate reflog on HEAD, show-branch -g without an explicit parameter defaults to the current branch, or HEAD when it is detached from branches. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-show-branch.c')
-rw-r--r--builtin-show-branch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index fa62e48..0d94e40 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -690,7 +690,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (ac == 0) {
static const char *fake_av[2];
- fake_av[0] = "HEAD";
+ const char *refname;
+
+ refname = resolve_ref("HEAD", sha1, 1, NULL);
+ fake_av[0] = xstrdup(refname);
fake_av[1] = NULL;
av = fake_av;
ac = 1;