mirror of
https://github.com/git/git
synced 2024-08-26 19:19:18 +00:00
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
This commit is contained in:
commit
b02a94d663
|
@ -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 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;
|
all_heads = 1;
|
||||||
|
|
||||||
if (reflog) {
|
if (reflog) {
|
||||||
|
@ -785,13 +785,13 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||||
}
|
}
|
||||||
free(ref);
|
free(ref);
|
||||||
}
|
}
|
||||||
else if (all_heads + all_remotes)
|
|
||||||
snarf_refs(all_heads, all_remotes);
|
|
||||||
else {
|
else {
|
||||||
while (0 < ac) {
|
while (0 < ac) {
|
||||||
append_one_rev(*av);
|
append_one_rev(*av);
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
}
|
}
|
||||||
|
if (all_heads + all_remotes)
|
||||||
|
snarf_refs(all_heads, all_remotes);
|
||||||
}
|
}
|
||||||
|
|
||||||
head_p = resolve_ref_unsafe("HEAD", RESOLVE_REF_READING,
|
head_p = resolve_ref_unsafe("HEAD", RESOLVE_REF_READING,
|
||||||
|
|
Loading…
Reference in a new issue