summaryrefslogtreecommitdiff
path: root/t/t4103-apply-binary.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4103-apply-binary.sh')
-rwxr-xr-xt/t4103-apply-binary.sh39
1 files changed, 21 insertions, 18 deletions
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh
index 1b420e3b5f..fad6d3f542 100755
--- a/t/t4103-apply-binary.sh
+++ b/t/t4103-apply-binary.sh
@@ -6,6 +6,9 @@
test_description='git apply handling binary patches
'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success 'setup' '
@@ -31,64 +34,64 @@ test_expect_success 'setup' '
git update-index --add --remove file1 file2 file3 file4 &&
git commit -m "Second Version" &&
- git diff-tree -p master binary >B.diff &&
- git diff-tree -p -C master binary >C.diff &&
+ git diff-tree -p main binary >B.diff &&
+ git diff-tree -p -C main binary >C.diff &&
- git diff-tree -p --binary master binary >BF.diff &&
- git diff-tree -p --binary -C master binary >CF.diff &&
+ git diff-tree -p --binary main binary >BF.diff &&
+ git diff-tree -p --binary -C main binary >CF.diff &&
- git diff-tree -p --full-index master binary >B-index.diff &&
- git diff-tree -p -C --full-index master binary >C-index.diff &&
+ git diff-tree -p --full-index main binary >B-index.diff &&
+ git diff-tree -p -C --full-index main binary >C-index.diff &&
- git diff-tree -p --binary --no-prefix master binary -- file3 >B0.diff &&
+ git diff-tree -p --binary --no-prefix main binary -- file3 >B0.diff &&
git init other-repo &&
(
cd other-repo &&
- git fetch .. master &&
+ git fetch .. main &&
git reset --hard FETCH_HEAD
)
'
test_expect_success 'stat binary diff -- should not fail.' \
- 'git checkout master &&
+ 'git checkout main &&
git apply --stat --summary B.diff'
test_expect_success 'stat binary -p0 diff -- should not fail.' '
- git checkout master &&
+ git checkout main &&
git apply --stat -p0 B0.diff
'
test_expect_success 'stat binary diff (copy) -- should not fail.' \
- 'git checkout master &&
+ 'git checkout main &&
git apply --stat --summary C.diff'
test_expect_success 'check binary diff -- should fail.' \
- 'git checkout master &&
+ 'git checkout main &&
test_must_fail git apply --check B.diff'
test_expect_success 'check binary diff (copy) -- should fail.' \
- 'git checkout master &&
+ 'git checkout main &&
test_must_fail git apply --check C.diff'
test_expect_success \
'check incomplete binary diff with replacement -- should fail.' '
- git checkout master &&
+ git checkout main &&
test_must_fail git apply --check --allow-binary-replacement B.diff
'
test_expect_success \
'check incomplete binary diff with replacement (copy) -- should fail.' '
- git checkout master &&
+ git checkout main &&
test_must_fail git apply --check --allow-binary-replacement C.diff
'
test_expect_success 'check binary diff with replacement.' \
- 'git checkout master &&
+ 'git checkout main &&
git apply --check --allow-binary-replacement BF.diff'
test_expect_success 'check binary diff with replacement (copy).' \
- 'git checkout master &&
+ 'git checkout main &&
git apply --check --allow-binary-replacement CF.diff'
# Now we start applying them.
@@ -96,7 +99,7 @@ test_expect_success 'check binary diff with replacement (copy).' \
do_reset () {
rm -f file? &&
git reset --hard &&
- git checkout -f master
+ git checkout -f main
}
test_expect_success 'apply binary diff -- should fail.' \