summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cc6985)
raw | patch | inline | side by side (parent: 1cc6985)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 9 Jul 2008 00:31:51 +0000 (17:31 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 9 Jul 2008 08:37:34 +0000 (01:37 -0700) |
We used to require the name of the commit to limit the branches shown to
the --contains option, but more recent --merged/--no-meregd defaults to
HEAD (and they do not allow arbitrary commit, which is a separate issue).
This teaches --contains to default to HEAD when no parameter is given.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the --contains option, but more recent --merged/--no-meregd defaults to
HEAD (and they do not allow arbitrary commit, which is a separate issue).
This teaches --contains to default to HEAD when no parameter is given.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-branch.c | patch | blob | history |
diff --git a/builtin-branch.c b/builtin-branch.c
index d279702ba9a90faa020fa2f102d595cec082be21..50cbc9c81a49d20cf289f3acc7843ce7170966d9 100644 (file)
--- a/builtin-branch.c
+++ b/builtin-branch.c
OPT_BOOLEAN( 0 , "color", &branch_use_color, "use colored output"),
OPT_SET_INT('r', NULL, &kinds, "act on remote-tracking branches",
REF_REMOTE_BRANCH),
- OPT_CALLBACK(0, "contains", &with_commit, "commit",
- "print only branches that contain the commit",
- opt_parse_with_commit),
+ {
+ OPTION_CALLBACK, 0, "contains", &with_commit, "commit",
+ "print only branches that contain the commit",
+ PARSE_OPT_LASTARG_DEFAULT,
+ opt_parse_with_commit, (intptr_t)"HEAD",
+ },
{
OPTION_CALLBACK, 0, "with", &with_commit, "commit",
"print only branches that contain the commit",
- PARSE_OPT_HIDDEN, opt_parse_with_commit,
+ PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
+ opt_parse_with_commit, (intptr_t) "HEAD",
},
OPT__ABBREV(&abbrev),