summaryrefslogtreecommitdiff
path: root/t/t5606-clone-options.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5606-clone-options.sh')
-rwxr-xr-xt/t5606-clone-options.sh38
1 files changed, 29 insertions, 9 deletions
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
index d822153..e93e0d0 100755
--- a/t/t5606-clone-options.sh
+++ b/t/t5606-clone-options.sh
@@ -4,6 +4,7 @@ test_description='basic clone options'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '
@@ -38,15 +39,16 @@ test_expect_success 'clone -o' '
test_expect_success 'rejects invalid -o/--origin' '
test_must_fail git clone -o "bad...name" parent clone-bad-name 2>err &&
- test_i18ngrep "'\''bad...name'\'' is not a valid remote name" err
+ test_grep "'\''bad...name'\'' is not a valid remote name" err
'
-test_expect_success 'disallows --bare with --origin' '
+test_expect_success 'clone --bare -o' '
- test_must_fail git clone -o foo --bare parent clone-bare-o 2>err &&
- test_debug "cat err" &&
- test_i18ngrep -e "--bare and --origin foo options are incompatible" err
+ git clone -o foo --bare parent clone-bare-o &&
+ (cd parent && pwd) >expect &&
+ git -C clone-bare-o config remote.foo.url >actual &&
+ test_cmp expect actual
'
@@ -54,14 +56,22 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err &&
test_debug "cat err" &&
- test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err
+ test_grep -e "options .--bare. and .--separate-git-dir. cannot be used together" err
+
+'
+test_expect_success 'disallows --bundle-uri with shallow options' '
+ for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD
+ do
+ test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&
+ grep "bundle-uri.* cannot be used together" err || return 1
+ done
'
test_expect_success 'reject cloning shallow repository' '
test_when_finished "rm -rf repo" &&
test_must_fail git clone --reject-shallow shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git clone --no-reject-shallow shallow-repo repo
'
@@ -69,7 +79,7 @@ test_expect_success 'reject cloning shallow repository' '
test_expect_success 'reject cloning non-local shallow repository' '
test_when_finished "rm -rf repo" &&
test_must_fail git clone --reject-shallow --no-local shallow-repo out 2>err &&
- test_i18ngrep -e "source repository is shallow, reject to clone." err &&
+ test_grep -e "source repository is shallow, reject to clone." err &&
git clone --no-reject-shallow --no-local shallow-repo repo
'
@@ -110,6 +120,16 @@ test_expect_success 'prefers -c config over --template config' '
'
+test_expect_success 'ignore --template config for core.bare' '
+
+ template="$TRASH_DIRECTORY/template-with-bare-config" &&
+ mkdir "$template" &&
+ git config --file "$template/config" core.bare true &&
+ git clone "--template=$template" parent clone-bare-config &&
+ test "$(git -C clone-bare-config config --local core.bare)" = "false" &&
+ test_path_is_missing clone-bare-config/HEAD
+'
+
test_expect_success 'prefers config "clone.defaultRemoteName" over default' '
test_config_global clone.defaultRemoteName from_config &&
@@ -129,7 +149,7 @@ test_expect_success 'redirected clone does not show progress' '
git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&
! grep % err &&
- test_i18ngrep ! "Checking connectivity" err
+ test_grep ! "Checking connectivity" err
'