]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t2004-checkout-cache-temp.sh
Merge branch 'js/ci-use-macos-13'
[thirdparty/git.git] / t / t2004-checkout-cache-temp.sh
index 9bb503a97578c1d43a01409a93e2dd4f7c207a43..45dd1bc8582142db6d35c7e1d708c8a27c243a34 100755 (executable)
@@ -57,7 +57,7 @@ test_expect_success 'checkout all stage 0 to temporary files' '
                test $(grep $f actual | cut "-d " -f2) = $f &&
                p=$(grep $f actual | cut "-d    " -f1) &&
                test -f $p &&
-               test $(cat $p) = tree1$f
+               test $(cat $p) = tree1$f || return 1
        done
 '
 
@@ -85,7 +85,7 @@ test_expect_success 'checkout all stage 2 to temporary files' '
                test $(grep $f actual | cut "-d " -f2) = $f &&
                p=$(grep $f actual | cut "-d    " -f1) &&
                test -f $p &&
-               test $(cat $p) = tree2$f
+               test $(cat $p) = tree2$f || return 1
        done
 '
 
@@ -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 &&