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 &&
19 git merge-recursive master -- a1 b1 &&
20 git ls-files -s file1 | grep ^100755
23 test_expect_success FILEMODE
'verify executable bit on file' '
27 test_expect_success
'mode change in both branches: expect conflict' '
28 git reset --hard HEAD &&
29 git checkout -b a2 master &&
31 H=$(git hash-object file2) &&
32 test_chmod +x file2 &&
34 git checkout -b b2 master &&
40 git merge-recursive master -- a2 b2
43 git ls-files -u >actual &&
45 echo "100755 $H 2 file2"
46 echo "100644 $H 3 file2"
48 test_cmp actual expect &&
49 git ls-files -s file2 | grep ^100755
52 test_expect_success FILEMODE
'verify executable bit on file' '
56 test_expect_success
'merging with triple rename across D/F conflict' '
57 git reset --hard HEAD &&
58 git checkout -b main &&
61 echo "just a file" >sub1 &&
63 echo content1 >sub2/file1 &&
64 echo content2 >sub2/file2 &&
65 echo content3 >sub2/file3 &&
67 echo base >simple/bar &&
72 git checkout -b other &&
73 echo more >>simple/bar &&
75 git commit -a -m changesimplefile &&
81 git commit -m changefiletodir &&