Signed-off-by: Miklos Vajna <redacted>
---
t/t6034-merge-tree.sh | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
create mode 100755 t/t6034-merge-tree.sh
diff --git a/t/t6034-merge-tree.sh b/t/t6034-merge-tree.sh
new file mode 100755
index 0000000..42bd5e7
--- /dev/null
+++ b/t/t6034-merge-tree.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+test_description='git merge-tree
+
+Testing merging two trees without touching the index.'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ echo c0 > c0.c &&
+ git add c0.c &&
+ git commit -m c0 &&
+ git tag c0 &&
+ echo c1 > c1.c &&
+ git add c1.c &&
+ git commit -m c1 &&
+ git tag c1 &&
+ c1=$(git hash-object c1.c)
+ git reset --hard c0 &&
+ echo c2 > c2.c &&
+ git add c2.c &&
+ git commit -m c2 &&
+ git tag c2
+ c2=$(git hash-object c2.c)
+'
+
+test_expect_success 'merge c1 with c2' '
+ cat <<EOF >expected &&
+added in local
+ our 100644 $c1 c1.c
+added in remote
+ their 100644 $c2 c2.c
+@@ -0,0 +1 @@
++c2
+EOF
+ git merge-tree c0 c1 c2 > actual &&
+ test_cmp expected actual
+'
+
+test_done
--
1.6.1