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

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

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Oct 13, 2008, 20:54 UTC
Message-ID
<1223931265-8862-1-git-send-email-vmiklos@frugalware.org>
In-Reply-To
<1217438608-28855-1-git-send-email-vmiklos@frugalware.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
[ Adding Shawn to CC as the interim maintainer. ]
On Wed, Jul 30, 2008 at 07:23:28PM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:
> Uh-oh. Here is a testcase that fails with master, but passes with your
> patch.

I remember you had a note about it's a bad habit to write a new test for every bug, so here is an updated version that just improves t7600-merge.sh and does not adds a new one.

 t/t7600-merge.sh |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 7313ac2..a4443a7 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -520,4 +520,30 @@ test_expect_success 'refresh the index before merging' '
 
 test_debug 'gitk --all'
 
+cat >expected <<EOF
+Merge branch 'c5' (early part)
+EOF
+
+test_expect_success 'merge early part of c2' '
+	git reset --hard c3 &&
+	echo c4 > c4.c &&
+	git add c4.c &&
+	git commit -m c4 &&
+	git tag c4 &&
+	echo c5 > c5.c &&
+	git add c5.c &&
+	git commit -m c5 &&
+	git tag c5 &&
+	git reset --hard c3 &&
+	echo c6 > c6.c &&
+	git add c6.c &&
+	git commit -m c6 &&
+	git tag c6 &&
+	git merge c5~1 &&
+	git show -s --pretty=format:%s HEAD > actual &&
+	test_cmp actual expected
+'
+
+test_debug 'gitk --all'
+
 test_done
-- 
1.6.0.2
Previous: Miklos VajnaNext: Shawn O. Pearce
Message 3 of 4 in “Fix merge name generation in "merge in C"”
  1. Fix merge name generation in "merge in C"Junio C Hamano, Jul 30, 2008
  2. Add testcase to ensure merging an early part of a branch is done properlyMiklos Vajna, Jul 30, 2008
  3. Add testcase to ensure merging an early part of a branch is done properlyMiklos Vajna, Oct 13, 2008
  4. Shawn O. PearceOct 13, 2008

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.