Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15
STALE3724d

[PATCH] Add testcase to ensure merging an early part of a branch is done properly

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:05
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Miklos Vajna <redacted>
---

On Wed, Jul 30, 2008 at 01:12:19AM -0700, Junio C Hamano [off-list ref] wrote:
In addition, the message forgot to skip "refs/heads/" it prefixed from
the
output.

Signed-off-by: Junio C Hamano <redacted>
---
 * It is a bit surprising that after beating merge-in-C to death, we
   still find a minor breakage like this.
Uh-oh. Here is a testcase that fails with master, but passes with your
patch.

Thanks for catching this.

 t/t7607-merge-early.sh |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100755 t/t7607-merge-early.sh
diff --git a/t/t7607-merge-early.sh b/t/t7607-merge-early.sh
new file mode 100755
index 0000000..9dd3ac5
--- /dev/null
+++ b/t/t7607-merge-early.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+test_description='git-merge
+
+Testing merging an early part of a branch.'
+
+. ./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 &&
+	echo c2 > c2.c &&
+	git add c2.c &&
+	git commit -m c2 &&
+	git tag c2 &&
+	git reset --hard c0 &&
+	echo c3 > c3.c &&
+	git add c3.c &&
+	git commit -m c3 &&
+	git tag c3
+'
+
+cat >expected <<EOF
+Merge branch 'c2' (early part)
+EOF
+
+test_expect_success 'merge early part of c2' '
+	git merge c2~1 &&
+	git show -s --pretty=format:%s HEAD > actual &&
+	test_cmp actual expected
+'
+
+test_done
-- 
1.6.0.rc0.14.g95f8.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help