]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1091-sparse-checkout-builtin.sh
The thirteenth batch
[thirdparty/git.git] / t / t1091-sparse-checkout-builtin.sh
index f67611da28e6e27125008e5e7073cec8a2fd8752..8c5cd651b4b80ba05ab9fab572e384806a8404dd 100755 (executable)
@@ -8,6 +8,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 GIT_TEST_SPLIT_INDEX=false
 export GIT_TEST_SPLIT_INDEX
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 list_files() {
@@ -334,7 +335,7 @@ test_expect_success 'cone mode: set with nested folders' '
 
 test_expect_success 'cone mode: add independent path' '
        git -C repo sparse-checkout set deep/deeper1 &&
-       git -C repo sparse-checkout add folder1 &&
+       git -C repo sparse-checkout add --end-of-options folder1 &&
        cat >expect <<-\EOF &&
        /*
        !/*/
@@ -886,6 +887,12 @@ test_expect_success 'by default, cone mode will error out when passed files' '
        grep ".gitignore.*is not a directory" error
 '
 
+test_expect_success 'error on mistyped command line options' '
+       test_must_fail git -C repo sparse-checkout add --sikp-checks .gitignore 2>error &&
+
+       grep "unknown option.*sikp-checks" error
+'
+
 test_expect_success 'by default, non-cone mode will warn on individual files' '
        git -C repo sparse-checkout reapply --no-cone &&
        git -C repo sparse-checkout add .gitignore 2>warning &&
@@ -962,7 +969,7 @@ test_expect_success 'check-rules non-cone mode' '
        git -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\
                >check-rules-file <all-files &&
 
-       cat rules | git -C repo sparse-checkout set --no-cone --stdin &&
+       git -C repo sparse-checkout set --no-cone --stdin <rules &&
        git -C repo ls-files -t >out &&
        sed -n "/^S /!s/^. //p" out >ls-files &&