echo hello >a &&
o0=$(git hash-object a) &&
cp a b &&
- cp a A &&
+ cp a c &&
mkdir d &&
cp a d/e &&
test_tick &&
- git add a b A d/e &&
+ git add a b c d/e &&
git commit -m initial &&
c0=$(git rev-parse --verify HEAD) &&
git branch side &&
c1=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o1 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o1 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o1 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'setup 2' '
- rm -rf [Aabd] &&
+ rm -rf [abcd] &&
git checkout side &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual &&
c2=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o2 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o2 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'setup 3' '
- rm -rf [Aabd] &&
+ rm -rf [abcd] &&
git checkout df-1 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual &&
c3=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o3 b/c"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o3 0 b/c"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'setup 4' '
- rm -rf [Aabd] &&
+ rm -rf [abcd] &&
git checkout df-2 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual &&
c4=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o4 a/c"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o4 0 a/c"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'setup 5' '
- rm -rf [Aabd] &&
+ rm -rf [abcd] &&
git checkout remove &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual &&
c5=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o5 a"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o5 0 a"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'setup 6' '
- rm -rf [Aabd] &&
+ rm -rf [abcd] &&
git checkout df-3 &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
) >expected &&
git diff -u expected actual &&
c6=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD ; git ls-files -s ) >actual &&
(
- echo "100644 blob $o0 A"
echo "100644 blob $o0 a"
echo "100644 blob $o0 b"
+ echo "100644 blob $o0 c"
echo "100644 blob $o6 d"
- echo "100644 $o0 0 A"
echo "100644 $o0 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o6 0 d"
) >expected &&
git diff -u expected actual
test_expect_success 'merge-recursive simple' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git checkout -f "$c2" &&
git-merge-recursive "$c0" -- "$c2" "$c1"
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o0 1 a"
echo "100644 $o2 2 a"
echo "100644 $o1 3 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'merge-recursive remove conflict' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git checkout -f "$c1" &&
git-merge-recursive "$c0" -- "$c1" "$c5"
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o0 1 a"
echo "100644 $o1 2 a"
echo "100644 $o5 3 a"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
'
test_expect_success 'merge-recursive d/f simple' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git reset --hard &&
git checkout -f "$c1" &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o1 0 a"
echo "100644 $o3 0 b/c"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'merge-recursive d/f conflict' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git reset --hard &&
git checkout -f "$c1" &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o0 1 a"
echo "100644 $o1 2 a"
echo "100644 $o4 0 a/c"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'merge-recursive d/f conflict the other way' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git reset --hard &&
git checkout -f "$c4" &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o0 1 a"
echo "100644 $o1 3 a"
echo "100644 $o4 0 a/c"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
test_expect_success 'merge-recursive d/f conflict' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git reset --hard &&
git checkout -f "$c1" &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o1 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o6 3 d"
echo "100644 $o0 1 d/e"
echo "100644 $o1 2 d/e"
test_expect_success 'merge-recursive d/f conflict' '
- rm -fr [Aabd] &&
+ rm -fr [abcd] &&
git reset --hard &&
git checkout -f "$c6" &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
echo "100644 $o1 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o6 2 d"
echo "100644 $o0 1 d/e"
echo "100644 $o1 3 d/e"
git read-tree --prefix=M/ master &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
- echo "100644 $o0 0 M/A"
echo "100644 $o1 0 M/a"
echo "100644 $o0 0 M/b"
+ echo "100644 $o0 0 M/c"
echo "100644 $o1 0 M/d/e"
echo "100644 $o1 0 a"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual &&
git read-tree --prefix=a1/ master &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
- echo "100644 $o0 0 M/A"
echo "100644 $o1 0 M/a"
echo "100644 $o0 0 M/b"
+ echo "100644 $o0 0 M/c"
echo "100644 $o1 0 M/d/e"
echo "100644 $o1 0 a"
- echo "100644 $o0 0 a1/A"
echo "100644 $o1 0 a1/a"
echo "100644 $o0 0 a1/b"
+ echo "100644 $o0 0 a1/c"
echo "100644 $o1 0 a1/d/e"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
) >expected &&
git diff -u expected actual
git read-tree --prefix=z/ master &&
git ls-files -s >actual &&
(
- echo "100644 $o0 0 A"
- echo "100644 $o0 0 M/A"
echo "100644 $o1 0 M/a"
echo "100644 $o0 0 M/b"
+ echo "100644 $o0 0 M/c"
echo "100644 $o1 0 M/d/e"
echo "100644 $o1 0 a"
- echo "100644 $o0 0 a1/A"
echo "100644 $o1 0 a1/a"
echo "100644 $o0 0 a1/b"
+ echo "100644 $o0 0 a1/c"
echo "100644 $o1 0 a1/d/e"
echo "100644 $o0 0 b"
+ echo "100644 $o0 0 c"
echo "100644 $o1 0 d/e"
- echo "100644 $o0 0 z/A"
echo "100644 $o1 0 z/a"
echo "100644 $o0 0 z/b"
+ echo "100644 $o0 0 z/c"
echo "100644 $o1 0 z/d/e"
) >expected &&
git diff -u expected actual