3 test_description
='merge-recursive: handle file mode'
6 test_expect_success
'mode change in one branch: keep changed version' '
9 git commit -m initial &&
10 git checkout -b a1 master &&
14 git checkout -b b1 master &&
15 test_chmod +x file1 &&
18 git merge-recursive master -- a1 b1 &&
19 git ls-files -s file1 | grep ^100755
22 test_expect_success FILEMODE
'verify executable bit on file' '
26 test_expect_success
'mode change in both branches: expect conflict' '
27 git reset --hard HEAD &&
28 git checkout -b a2 master &&
30 H=$(git hash-object file2) &&
31 test_chmod +x file2 &&
33 git checkout -b b2 master &&
39 git merge-recursive master -- a2 b2
42 git ls-files -u >actual &&
44 echo "100755 $H 2 file2"
45 echo "100644 $H 3 file2"
47 test_cmp actual expect &&
48 git ls-files -s file2 | grep ^100755
51 test_expect_success FILEMODE
'verify executable bit on file' '
55 test_expect_success
'merging with triple rename across D/F conflict' '
56 git reset --hard HEAD &&
57 git checkout -b main &&
60 echo "just a file" >sub1 &&
62 echo content1 >sub2/file1 &&
63 echo content2 >sub2/file2 &&
64 echo content3 >sub2/file3 &&
66 echo base >simple/bar &&
71 git checkout -b other &&
72 echo more >>simple/bar &&
74 git commit -a -m changesimplefile &&
80 git commit -m changefiletodir &&