summaryrefslogtreecommitdiff
path: root/t/t6026-merge-attr.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6026-merge-attr.sh')
-rwxr-xr-xt/t6026-merge-attr.sh46
1 files changed, 40 insertions, 6 deletions
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
index 56fc341768..5e439972be 100755
--- a/t/t6026-merge-attr.sh
+++ b/t/t6026-merge-attr.sh
@@ -70,6 +70,18 @@ test_expect_success 'check merge result in working tree' '
'
+test_expect_success 'retry the merge with longer context' '
+ echo text conflict-marker-size=32 >>.gitattributes &&
+ git checkout -m text &&
+ sed -ne "/^\([<=>]\)\1\1\1*/{
+ s/ .*$//
+ p
+ }" >actual text &&
+ grep ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" actual &&
+ grep "================================" actual &&
+ grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual
+'
+
cat >./custom-merge <<\EOF
#!/bin/sh
@@ -106,9 +118,9 @@ test_expect_success 'custom merge backend' '
cmp binary union &&
sed -e 1,3d text >check-1 &&
- o=$(git-unpack-file master^:text) &&
- a=$(git-unpack-file side^:text) &&
- b=$(git-unpack-file master:text) &&
+ o=$(git unpack-file master^:text) &&
+ a=$(git unpack-file side^:text) &&
+ b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
@@ -133,13 +145,35 @@ test_expect_success 'custom merge backend' '
cmp binary union &&
sed -e 1,3d text >check-1 &&
- o=$(git-unpack-file master^:text) &&
- a=$(git-unpack-file anchor:text) &&
- b=$(git-unpack-file master:text) &&
+ o=$(git unpack-file master^:text) &&
+ a=$(git unpack-file anchor:text) &&
+ b=$(git unpack-file master:text) &&
sh -c "./custom-merge $o $a $b 0" &&
sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 &&
rm -f $o $a $b
'
+test_expect_success 'up-to-date merge without common ancestor' '
+ test_create_repo repo1 &&
+ test_create_repo repo2 &&
+ test_tick &&
+ (
+ cd repo1 &&
+ >a &&
+ git add a &&
+ git commit -m initial
+ ) &&
+ test_tick &&
+ (
+ cd repo2 &&
+ git commit --allow-empty -m initial
+ ) &&
+ test_tick &&
+ (
+ cd repo1 &&
+ git pull ../repo2 master
+ )
+'
+
test_done