merge(3p/git): Merge git subtree at v2.29.2
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
This commit is contained in:
parent
082c006c04
commit
f4609b896f
1485 changed files with 241535 additions and 109418 deletions
33
third_party/git/t/t0040-parse-options.sh
vendored
33
third_party/git/t/t0040-parse-options.sh
vendored
|
|
@ -23,6 +23,8 @@ usage: test-tool parse-options <options>
|
|||
-j <n> get a integer, too
|
||||
-m, --magnitude <n> get a magnitude
|
||||
--set23 set integer to 23
|
||||
--mode1 set integer to 1 (cmdmode option)
|
||||
--mode2 set integer to 2 (cmdmode option)
|
||||
-L, --length <str> get length of <str>
|
||||
-F, --file <file> set file to <file>
|
||||
|
||||
|
|
@ -42,7 +44,7 @@ Magic arguments
|
|||
--no-ambiguous negative ambiguity
|
||||
|
||||
Standard options
|
||||
--abbrev[=<n>] use <n> digits to display SHA-1s
|
||||
--abbrev[=<n>] use <n> digits to display object names
|
||||
-v, --verbose be verbose
|
||||
-n, --dry-run dry run
|
||||
-q, --quiet be quiet
|
||||
|
|
@ -52,7 +54,7 @@ Alias
|
|||
-A, --alias-source <string>
|
||||
get a string
|
||||
-Z, --alias-target <string>
|
||||
get a string
|
||||
alias of --alias-source
|
||||
|
||||
EOF
|
||||
|
||||
|
|
@ -242,7 +244,7 @@ test_expect_success 'Alias options do not contribute to abbreviation' '
|
|||
'
|
||||
|
||||
cat >typo.err <<\EOF
|
||||
error: did you mean `--boolean` (with two dashes ?)
|
||||
error: did you mean `--boolean` (with two dashes)?
|
||||
EOF
|
||||
|
||||
test_expect_success 'detect possible typos' '
|
||||
|
|
@ -252,7 +254,7 @@ test_expect_success 'detect possible typos' '
|
|||
'
|
||||
|
||||
cat >typo.err <<\EOF
|
||||
error: did you mean `--ambiguous` (with two dashes ?)
|
||||
error: did you mean `--ambiguous` (with two dashes)?
|
||||
EOF
|
||||
|
||||
test_expect_success 'detect possible typos' '
|
||||
|
|
@ -324,6 +326,22 @@ test_expect_success 'OPT_NEGBIT() works' '
|
|||
test-tool parse-options --expect="boolean: 6" -bb --no-neg-or4
|
||||
'
|
||||
|
||||
test_expect_success 'OPT_CMDMODE() works' '
|
||||
test-tool parse-options --expect="integer: 1" --mode1
|
||||
'
|
||||
|
||||
test_expect_success 'OPT_CMDMODE() detects incompatibility' '
|
||||
test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err &&
|
||||
test_must_be_empty output &&
|
||||
test_i18ngrep "incompatible with --mode" output.err
|
||||
'
|
||||
|
||||
test_expect_success 'OPT_CMDMODE() detects incompatibility with something else' '
|
||||
test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err &&
|
||||
test_must_be_empty output &&
|
||||
test_i18ngrep "incompatible with something else" output.err
|
||||
'
|
||||
|
||||
test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '
|
||||
test-tool parse-options --expect="boolean: 6" + + + + + +
|
||||
'
|
||||
|
|
@ -399,4 +417,11 @@ test_expect_success 'GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS works' '
|
|||
test-tool parse-options --ye
|
||||
'
|
||||
|
||||
test_expect_success '--end-of-options treats remainder as args' '
|
||||
test-tool parse-options \
|
||||
--expect="verbose: -1" \
|
||||
--expect="arg 00: --verbose" \
|
||||
--end-of-options --verbose
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue