summaryrefslogtreecommitdiff
path: root/t/t2026-checkout-pathspec-file.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-01-30 22:17:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-30 22:17:08 (GMT)
commit96aef8f68404964c48d0d85ce04f6b2d84097246 (patch)
tree91c0f4bac02e2932ce5166586359c6b074a16b44 /t/t2026-checkout-pathspec-file.sh
parentd52adee7790352c96fa37558206e6db8866879d2 (diff)
parentf94f7bd00d06c6b651a0e7afcc90ac86cc5f391b (diff)
downloadgit-96aef8f68404964c48d0d85ce04f6b2d84097246.zip
git-96aef8f68404964c48d0d85ce04f6b2d84097246.tar.gz
git-96aef8f68404964c48d0d85ce04f6b2d84097246.tar.bz2
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/t2026-checkout-pathspec-file.sh')
-rwxr-xr-xt/t2026-checkout-pathspec-file.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t2026-checkout-pathspec-file.sh b/t/t2026-checkout-pathspec-file.sh
index adad71f..43d31d7 100755
--- a/t/t2026-checkout-pathspec-file.sh
+++ b/t/t2026-checkout-pathspec-file.sh
@@ -143,4 +143,21 @@ test_expect_success 'only touches what was listed' '
verify_expect
'
+test_expect_success 'error conditions' '
+ restore_checkpoint &&
+ echo fileA.t >list &&
+
+ test_must_fail git checkout --pathspec-from-file=list --detach 2>err &&
+ test_i18ngrep -e "--pathspec-from-file is incompatible with --detach" err &&
+
+ test_must_fail git checkout --pathspec-from-file=list --patch 2>err &&
+ test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err &&
+
+ test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err &&
+ test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err &&
+
+ test_must_fail git checkout --pathspec-file-nul 2>err &&
+ test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err
+'
+
test_done