* [PATCH] Add new testcase for git-merge-tree
@ 2009-01-25 18:03 Miklos Vajna
0 siblings, 0 replies; only message in thread
From: Miklos Vajna @ 2009-01-25 18:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-25 18:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-25 18:03 [PATCH] Add new testcase for git-merge-tree Miklos Vajna
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).