aboutsummaryrefslogtreecommitdiffstats
path: root/parse-options.c
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2023-08-16 07:24:56 +0800
committerJiang Xin <worldhello.net@gmail.com>2023-08-16 07:24:56 +0800
commit62a26b36bd9bf76feb6940e2bee732bd62b429f8 (patch)
tree3500be70c7d872566578e3fa324f1a8d1fe796e7 /parse-options.c
parent450f2c9e3e461e4785643730f9c82eb9a64faddd (diff)
parentf1ed9d7dc0e49dc1a044941d821c9d2342313c26 (diff)
downloadgit-62a26b36bd9bf76feb6940e2bee732bd62b429f8.tar.gz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (34 commits) Git 2.42-rc2 t4053: avoid writing to unopened pipe t4053: avoid race when killing background processes Git 2.42-rc1 git maintenance: avoid console window in scheduled tasks on Windows win32: add a helper to run `git.exe` without a foreground window t9001: remove excessive GIT_SEND_EMAIL_NOTTY=1 mv: handle lstat() failure correctly parse-options: disallow negating OPTION_SET_INT 0 repack: free geometry struct send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack t0040: declare non-tab indentation to be okay in this script advice: handle "rebase" in error_resolve_conflict() A few more topics before -rc1 mailmap: change primary address for Glen Choo gitignore: ignore clangd .cache directory docs: update when `git bisect visualize` uses `gitk` compat/mingw: implement a native locate_in_PATH() run-command: conditionally define locate_in_PATH() ...
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c
index 87c9fae634..60224cf8d0 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -480,6 +480,9 @@ static void parse_options_check(const struct option *opts)
opts->long_name))
optbug(opts, "uses feature "
"not supported for dashless options");
+ if (opts->type == OPTION_SET_INT && !opts->defval &&
+ opts->long_name && !(opts->flags & PARSE_OPT_NONEG))
+ optbug(opts, "OPTION_SET_INT 0 should not be negatable");
switch (opts->type) {
case OPTION_COUNTUP:
case OPTION_BIT: