3 test_description
='merge-recursive: handle file mode'
5 .
"$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
7 test_expect_success
'mode change in one branch: keep changed version' '
10 git commit -m initial &&
11 git checkout -b a1 master &&
15 git checkout -b b1 master &&
16 test_chmod +x file1 &&
20 git merge-recursive master -- a1 b1 &&
21 git ls-files -s file1 | grep ^100755
24 test_expect_success FILEMODE
'verify executable bit on file' '
28 test_expect_success
'mode change in both branches: expect conflict' '
29 git reset --hard HEAD &&
30 git checkout -b a2 master &&
32 H=$(git hash-object file2) &&
33 test_chmod +x file2 &&
35 git checkout -b b2 master &&
41 git merge-recursive master -- a2 b2
44 git ls-files -u >actual &&
46 echo "100755 $H 2 file2"
47 echo "100644 $H 3 file2"
49 test_cmp actual expect &&
50 git ls-files -s file2 | grep ^100755
53 test_expect_success FILEMODE
'verify executable bit on file' '
57 test_expect_success
'merging with triple rename across D/F conflict' '
58 git reset --hard HEAD &&
59 git checkout -b main &&
62 echo "just a file" >sub1 &&
64 echo content1 >sub2/file1 &&
65 echo content2 >sub2/file2 &&
66 echo content3 >sub2/file3 &&
68 echo base >simple/bar &&
73 git checkout -b other &&
74 echo more >>simple/bar &&
76 git commit -a -m changesimplefile &&
82 git commit -m changefiletodir &&