]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1300-config.sh
builtin/config: use `OPT_CMDMODE()` to specify modes
[thirdparty/git.git] / t / t1300-config.sh
index 9b65d9eaf5f5e475b6d235b4670ec46603d4b0b3..86dc70769ac43d59b5037821099c5391f042fb23 100755 (executable)
@@ -2738,4 +2738,17 @@ test_expect_success 'includeIf.hasconfig:remote.*.url forbids remote url in such
        grep "fatal: remote URLs cannot be configured in file directly or indirectly included by includeIf.hasconfig:remote.*.url" err
 '
 
+test_expect_success 'negated mode causes failure' '
+       test_must_fail git config --no-get 2>err &&
+       grep "unknown option \`no-get${SQ}" err
+'
+
+test_expect_success 'specifying multiple modes causes failure' '
+       cat >expect <<-EOF &&
+       error: options ${SQ}--get-all${SQ} and ${SQ}--get${SQ} cannot be used together
+       EOF
+       test_must_fail git config --get --get-all 2>err &&
+       test_cmp expect err
+'
+
 test_done