Skip to content

Commit eab98ee

Browse files
avargitster
authored andcommitted
parse-options: add OPT_NONEG to the "contains" option
Add the OPT_NONEG flag to the "contains" option and its hidden synonym "with". Since this was added in commit 694a577 ("git-branch --contains=commit", 2007-11-07) giving --no-{contains,with} hasn't been an error, but has emitted the help output since filter.with_commit wouldn't get set. Now git will emit "error: unknown option `no-{contains,with}'" at the top of the help output. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf74804 commit eab98ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parse-options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ extern int parse_opt_passthru_argv(const struct option *, const char *, int);
258258
PARSE_OPT_LASTARG_DEFAULT | flag, \
259259
parse_opt_commits, (intptr_t) "HEAD" \
260260
}
261-
#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, 0)
262-
#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN)
261+
#define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, PARSE_OPT_NONEG)
262+
#define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN | PARSE_OPT_NONEG)
263263

264264
#endif

0 commit comments

Comments
 (0)