git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Add new testcase for git-merge-tree

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jan 25, 2009, 18:03 UTC
Message-ID
<1232906585-12250-1-git-send-email-vmiklos@frugalware.org>
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
Message 1 of 1 in “Add new testcase for git-merge-tree”
  1. Add new testcase for git-merge-treeMiklos Vajna, Jan 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.