summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-06 04:00:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-06 04:00:26 (GMT)
commitb02a94d6631bd2169d11d3dc7d2ebc21e2dfca30 (patch)
treede987a2bf861fce394e4cf6d2fb881e3f291d26d /builtin/show-branch.c
parent8ff1ddd71731d42e349bacdf515cefa021c4aa03 (diff)
parent539d09c3b4d55d3bf652133d0244aa694cc1b444 (diff)
downloadgit-b02a94d6631bd2169d11d3dc7d2ebc21e2dfca30.zip
git-b02a94d6631bd2169d11d3dc7d2ebc21e2dfca30.tar.gz
git-b02a94d6631bd2169d11d3dc7d2ebc21e2dfca30.tar.bz2
Merge branch 'mh/show-branch-topic'
"git show-branch --topics HEAD" (with no other arguments) did not do anything interesting. Instead, contrast the given revision against all the local branches by default. * mh/show-branch-topic: show-branch: show all local heads when only giving one rev along --topics
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r--builtin/show-branch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index f3fb5fb..e69fb7c 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -718,7 +718,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
}
/* If nothing is specified, show all branches by default */
- if (ac + all_heads + all_remotes == 0)
+ if (ac <= topics && all_heads + all_remotes == 0)
all_heads = 1;
if (reflog) {
@@ -785,13 +785,13 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
}
free(ref);
}
- else if (all_heads + all_remotes)
- snarf_refs(all_heads, all_remotes);
else {
while (0 < ac) {
append_one_rev(*av);
ac--; av++;
}
+ if (all_heads + all_remotes)
+ snarf_refs(all_heads, all_remotes);
}
head_p = resolve_ref_unsafe("HEAD", RESOLVE_REF_READING,