git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Miklos Vajna <vmiklos@frugalware.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH] New test to check the real "subtree" case
Date: Thu, 28 Feb 2008 02:51:22 +0100	[thread overview]
Message-ID: <20080228015122.GB31441@genesis.frugalware.org> (raw)
In-Reply-To: <7vprun32m2.fsf@gitster.siamese.dyndns.org>

t6029 already checks if subtree available and works like recursive, but
this new one actually tests the extra functionality the subtree merge
strategy provides.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

On Sat, Feb 23, 2008 at 11:16:21AM -0800, Junio C Hamano <gitster@pobox.com> wrote:
> A new test t6029 currently only tests the strategy is available,
> but it should be enhanced to check the real "subtree" case.

i think something like this should do it.

 t/t3035-merge-subtree.sh |   54 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100755 t/t3035-merge-subtree.sh

diff --git a/t/t3035-merge-subtree.sh b/t/t3035-merge-subtree.sh
new file mode 100755
index 0000000..e400dce
--- /dev/null
+++ b/t/t3035-merge-subtree.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+test_description='merge-subtree backend test'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	mkdir git-gui &&
+	cd git-gui &&
+	git init &&
+	echo git-gui > git-gui.sh &&
+	o1=$(git hash-object git-gui.sh) &&
+	git add git-gui.sh &&
+	git commit -m "initial git-gui" &&
+	cd .. &&
+	mkdir git &&
+	cd git &&
+	git init &&
+	echo git >git.c &&
+	o2=$(git hash-object git.c) &&
+	git add git.c &&
+	git commit -m "initial git"
+'
+
+test_expect_success 'initial merge' '
+	git remote add -f gui ../git-gui &&
+	git merge -s ours --no-commit gui/master &&
+	git read-tree --prefix=git-gui/ -u gui/master &&
+	git commit -m "Merge git-gui as our subdirectory" &&
+	git ls-files -s >actual &&
+	(
+		echo "100644 $o1 0	git-gui/git-gui.sh"
+		echo "100644 $o2 0	git.c"
+	) >expected &&
+	git diff -u expected actual
+'
+
+test_expect_success 'merge update' '
+	cd ../git-gui &&
+	echo git-gui2 > git-gui.sh &&
+	o3=$(git hash-object git-gui.sh) &&
+	git add git-gui.sh &&
+	git commit -m "update git-gui" &&
+	cd ../git &&
+	git pull -s subtree gui master &&
+	git ls-files -s >actual &&
+	(
+		echo "100644 $o3 0	git-gui/git-gui.sh"
+		echo "100644 $o2 0	git.c"
+	) >expected &&
+	git diff -u expected actual
+'
+
+test_done
-- 
1.5.4.3

  parent reply	other threads:[~2008-02-28  1:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 19:16 [PATCH] Add merge-subtree back Junio C Hamano
2008-02-24  6:19 ` Daniel Barkalow
2008-02-28  1:51 ` Miklos Vajna [this message]
2008-02-28  9:45   ` [PATCH] New test to check the real "subtree" case Johannes Schindelin
2008-02-28 12:36     ` [PATCH] Improve t6029 " Miklos Vajna
2008-02-28 14:57       ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080228015122.GB31441@genesis.frugalware.org \
    --to=vmiklos@frugalware.org \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).