t / t6031-merge-recursive.shon commit Merge branch 'maint-1.5.4' into maint (4c414e2)
   1#!/bin/sh
   2
   3test_description='merge-recursive: handle file mode'
   4. ./test-lib.sh
   5
   6test_expect_success 'mode change in one branch: keep changed version' '
   7        : >file1 &&
   8        git add file1 &&
   9        git commit -m initial &&
  10        git checkout -b a1 master &&
  11        : >dummy &&
  12        git add dummy &&
  13        git commit -m a &&
  14        git checkout -b b1 master &&
  15        chmod +x file1 &&
  16        git add file1 &&
  17        git commit -m b1 &&
  18        git checkout a1 &&
  19        git merge-recursive master -- a1 b1 &&
  20        test -x file1
  21'
  22
  23test_expect_success 'mode change in both branches: expect conflict' '
  24        git reset --hard HEAD &&
  25        git checkout -b a2 master &&
  26        : >file2 &&
  27        H=$(git hash-object file2) &&
  28        chmod +x file2 &&
  29        git add file2 &&
  30        git commit -m a2 &&
  31        git checkout -b b2 master &&
  32        : >file2 &&
  33        git add file2 &&
  34        git commit -m b2 &&
  35        git checkout a2 &&
  36        (
  37                git merge-recursive master -- a2 b2
  38                test $? = 1
  39        ) &&
  40        git ls-files -u >actual &&
  41        (
  42                echo "100755 $H 2       file2"
  43                echo "100644 $H 3       file2"
  44        ) >expect &&
  45        test_cmp actual expect &&
  46        test -x file2
  47'
  48
  49test_done