diff options
Diffstat (limited to 't/t2004-checkout-cache-temp.sh')
-rwxr-xr-x | t/t2004-checkout-cache-temp.sh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh index b16d69ca4a..98e818f09f 100755 --- a/t/t2004-checkout-cache-temp.sh +++ b/t/t2004-checkout-cache-temp.sh @@ -93,7 +93,7 @@ test_expect_success 'checkout all stages of unknown path' ' rm -f path* .merge_* actual && test_must_fail git checkout-index --stage=all --temp \ -- does-not-exist 2>stderr && - test_i18ngrep not.in.the.cache stderr + test_grep not.in.the.cache stderr ' test_expect_success 'checkout all stages/one file to nothing' ' @@ -117,6 +117,26 @@ test_expect_success 'checkout all stages/one file to temporary files' ' test $(cat $s3) = tree3path1) ' +test_expect_success '--stage=all implies --temp' ' + rm -f path* .merge_* actual && + git checkout-index --stage=all -- path1 && + test_path_is_missing path1 +' + +test_expect_success 'overriding --stage=all resets implied --temp' ' + rm -f path* .merge_* actual && + git checkout-index --stage=all --stage=2 -- path1 && + echo tree2path1 >expect && + test_cmp expect path1 +' + +test_expect_success '--stage=all --no-temp is rejected' ' + rm -f path* .merge_* actual && + test_must_fail git checkout-index --stage=all --no-temp -- path1 2>err && + grep -v "already exists" err && + grep "options .--stage=all. and .--no-temp. cannot be used together" err +' + test_expect_success 'checkout some stages/one file to temporary files' ' rm -f path* .merge_* actual && git checkout-index --stage=all --temp -- path2 >actual && |