diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-01-30 14:17:08 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-01-30 14:17:08 -0800 |
| commit | 96aef8f68404964c48d0d85ce04f6b2d84097246 (patch) | |
| tree | 91c0f4bac02e2932ce5166586359c6b074a16b44 /t/t7526-commit-pathspec-file.sh | |
| parent | Merge branch 'ds/graph-horizontal-edges' (diff) | |
| parent | t: add tests for error conditions with --pathspec-from-file (diff) | |
| download | git-96aef8f68404964c48d0d85ce04f6b2d84097246.tar.gz git-96aef8f68404964c48d0d85ce04f6b2d84097246.zip | |
Merge branch 'am/test-pathspec-f-f-error-cases'
More tests.
* am/test-pathspec-f-f-error-cases:
t: add tests for error conditions with --pathspec-from-file
Diffstat (limited to 't/t7526-commit-pathspec-file.sh')
| -rwxr-xr-x | t/t7526-commit-pathspec-file.sh | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/t/t7526-commit-pathspec-file.sh b/t/t7526-commit-pathspec-file.sh index 4a7c11368d..5fbe47ebcd 100755 --- a/t/t7526-commit-pathspec-file.sh +++ b/t/t7526-commit-pathspec-file.sh @@ -134,10 +134,31 @@ test_expect_success 'only touches what was listed' ' verify_expect ' -test_expect_success '--pathspec-from-file and --all cannot be used together' ' +test_expect_success 'error conditions' ' restore_checkpoint && - test_must_fail git commit --pathspec-from-file=- --all -m "Commit" 2>err && - test_i18ngrep "[-]-pathspec-from-file with -a does not make sense" err + echo fileA.t >list && + >empty_list && + + test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err && + test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + + test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err && + test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && + + test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err && + test_i18ngrep -e "--pathspec-from-file with -a does not make sense" err && + + test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err && + test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + + test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && + test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + + test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err && + test_i18ngrep -e "No paths with --include/--only does not make sense." err && + + test_must_fail git commit --pathspec-from-file=empty_list --only -m "Commit" 2>err && + test_i18ngrep -e "No paths with --include/--only does not make sense." err ' test_done |
