3 test_description
='merge-recursive: handle file mode'
6 if ! test "$(git config --bool core.filemode)" = false
8 test_set_prereq FILEMODE
11 test_expect_success
'mode change in one branch: keep changed version' '
14 git commit -m initial &&
15 git checkout -b a1 master &&
19 git checkout -b b1 master &&
20 test_chmod +x file1 &&
23 git merge-recursive master -- a1 b1 &&
24 git ls-files -s file1 | grep ^100755
27 test_expect_success FILEMODE
'verify executable bit on file' '
31 test_expect_success
'mode change in both branches: expect conflict' '
32 git reset --hard HEAD &&
33 git checkout -b a2 master &&
35 H=$(git hash-object file2) &&
36 test_chmod +x file2 &&
38 git checkout -b b2 master &&
44 git merge-recursive master -- a2 b2
47 git ls-files -u >actual &&
49 echo "100755 $H 2 file2"
50 echo "100644 $H 3 file2"
52 test_cmp actual expect &&
53 git ls-files -s file2 | grep ^100755
56 test_expect_success FILEMODE
'verify executable bit on file' '