diff options
Diffstat (limited to 't/t4122-apply-symlink-inside.sh')
-rwxr-xr-x | t/t4122-apply-symlink-inside.sh | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh index 4acb3f3..2089d84 100755 --- a/t/t4122-apply-symlink-inside.sh +++ b/t/t4122-apply-symlink-inside.sh @@ -1,6 +1,10 @@ #!/bin/sh test_description='apply to deeper directory without getting fooled with symlink' +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 ' @@ -35,11 +39,11 @@ test_expect_success apply ' test_expect_success 'check result' ' - git diff --exit-code master && - git diff --exit-code --cached master && + git diff --exit-code main && + git diff --exit-code --cached main && test_tick && git commit -m replay && - T1=$(git rev-parse "master^{tree}") && + T1=$(git rev-parse "main^{tree}") && T2=$(git rev-parse "HEAD^{tree}") && test "z$T1" = "z$T2" @@ -91,19 +95,19 @@ test_expect_success SYMLINKS 'do not follow symbolic link (same input)' ' # same input creates a confusing symbolic link test_must_fail git apply patch 2>error-wt && - test_i18ngrep "beyond a symbolic link" error-wt && + test_grep "beyond a symbolic link" error-wt && test_path_is_missing arch/x86_64/dir && test_path_is_missing arch/i386/dir/file && test_must_fail git apply --index patch 2>error-ix && - test_i18ngrep "beyond a symbolic link" error-ix && + test_grep "beyond a symbolic link" error-ix && test_path_is_missing arch/x86_64/dir && test_path_is_missing arch/i386/dir/file && test_must_fail git ls-files --error-unmatch arch/x86_64/dir && test_must_fail git ls-files --error-unmatch arch/i386/dir && test_must_fail git apply --cached patch 2>error-ct && - test_i18ngrep "beyond a symbolic link" error-ct && + test_grep "beyond a symbolic link" error-ct && test_must_fail git ls-files --error-unmatch arch/x86_64/dir && test_must_fail git ls-files --error-unmatch arch/i386/dir && @@ -131,23 +135,23 @@ test_expect_success SYMLINKS 'do not follow symbolic link (existing)' ' git add arch/x86_64/dir && test_must_fail git apply add_file.patch 2>error-wt-add && - test_i18ngrep "beyond a symbolic link" error-wt-add && + test_grep "beyond a symbolic link" error-wt-add && test_path_is_missing arch/i386/dir/file && mkdir arch/i386/dir && >arch/i386/dir/file && test_must_fail git apply del_file.patch 2>error-wt-del && - test_i18ngrep "beyond a symbolic link" error-wt-del && + test_grep "beyond a symbolic link" error-wt-del && test_path_is_file arch/i386/dir/file && rm arch/i386/dir/file && test_must_fail git apply --index add_file.patch 2>error-ix-add && - test_i18ngrep "beyond a symbolic link" error-ix-add && + test_grep "beyond a symbolic link" error-ix-add && test_path_is_missing arch/i386/dir/file && test_must_fail git ls-files --error-unmatch arch/i386/dir && test_must_fail git apply --cached add_file.patch 2>error-ct-file && - test_i18ngrep "beyond a symbolic link" error-ct-file && + test_grep "beyond a symbolic link" error-ct-file && test_must_fail git ls-files --error-unmatch arch/i386/dir ' |