git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Greene <greened@obbligato.org>
To: git@vger.kernel.org
Cc: techlivezheng@gmail.com, alex.crezoff@gmail.com,
	davvid@gmail.com, cbailey32@bloomberg.net, danny0838@gmail.com,
	prohaska@zib.de, th.acker@arcor.de, sschuberth@gmail.com,
	peff@peff.net, gitter.spiros@gmail.com, nod.helm@gmail.com,
	"David A . Greene" <greened@obbligato.org>
Subject: [PATCH 5/7] contrib/subtree: Add split tests
Date: Thu,  5 Nov 2015 21:35:01 -0600	[thread overview]
Message-ID: <1446780903-22156-6-git-send-email-greened@obbligato.org> (raw)
In-Reply-To: <1446780903-22156-1-git-send-email-greened@obbligato.org>

From: Techlive Zheng <techlivezheng@gmail.com>

Add tests to check various options to split.  Check combinations of
--prefix, --message, --annotate, --branch and --rejoin.

Signed-off-by: Techlive Zheng <techlivezheng@gmail.com>
Signed-off-by: David A. Greene <greened@obbligato.org>
---
 contrib/subtree/t/t7900-subtree.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 7d59a1a..6250194 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -250,7 +250,6 @@ test_expect_success 'split requires path given by option --prefix must exist' '
 
 test_expect_success 'check if --message works for split+rejoin' '
 	spl1=''"$(git subtree split --annotate='"'*'"' --prefix "sub dir" --onto FETCH_HEAD --message "Split & rejoin" --rejoin)"'' &&
-	git branch spl1 "$spl1" &&
 	check_equal ''"$(last_commit_message)"'' "Split & rejoin" &&
 	undo
 '
@@ -282,7 +281,21 @@ test_expect_success 'check split with --branch for an incompatible branch' '
 	test_must_fail git subtree split --prefix "sub dir" --onto FETCH_HEAD --branch subdir
 '
 
-test_expect_success 'check split+rejoin' '
+test_expect_success 'split sub dir/ with --rejoin' '
+	spl1=$(git subtree split --prefix="sub dir" --annotate="*") &&
+	git branch spl1 "$spl1" &&
+	git subtree split --prefix="sub dir" --annotate="*" --rejoin &&
+	check_equal "$(last_commit_message)" "Split '\''sub dir/'\'' into commit '\''$spl1'\''" &&
+	undo
+'
+
+test_expect_success 'split sub dir/ with --rejoin and --message' '
+	git subtree split --prefix="sub dir" --message="Split & rejoin" --annotate="*" --rejoin &&
+	check_equal "$(last_commit_message)" "Split & rejoin" &&
+	undo
+'
+
+test_expect_success 'check split+rejoin+onto' '
 	spl1=''"$(git subtree split --annotate='"'*'"' --prefix "sub dir" --onto FETCH_HEAD --message "Split & rejoin" --rejoin)"'' &&
 	undo &&
 	git subtree split --annotate='"'*'"' --prefix "sub dir" --onto FETCH_HEAD --rejoin &&
-- 
2.6.1

  parent reply	other threads:[~2015-11-06  4:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  3:34 (unknown), David Greene
2015-11-06  3:34 ` [PATCH 1/7] contrib/subtree: Clean and refactor test code David Greene
2015-11-11  2:52   ` David A. Greene
2015-11-06  3:34 ` [PATCH 2/7] contrib/subtree: Add test for missing subtree David Greene
2015-11-06  3:34 ` [PATCH 3/7] contrib/subtree: Add tests for subtree add David Greene
2015-11-06  3:35 ` [PATCH 4/7] contrib/subtree: Add merge tests David Greene
2015-11-06  3:35 ` David Greene [this message]
2015-11-06  3:35 ` [PATCH 6/7] contrib/subtree: Make each test self-contained David Greene
2015-11-06  3:35 ` [PATCH 7/7] contrib/subtree: Handle '--prefix' argument with a slash appended David Greene
  -- strict thread matches above, loose matches on Subject: below --
2015-11-13  2:32 [PATCH 0/7] contrib/subtree: Testsuite cleanup David Greene
2015-11-13  2:32 ` [PATCH 5/7] contrib/subtree: Add split tests David Greene

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=1446780903-22156-6-git-send-email-greened@obbligato.org \
    --to=greened@obbligato.org \
    --cc=alex.crezoff@gmail.com \
    --cc=cbailey32@bloomberg.net \
    --cc=danny0838@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitter.spiros@gmail.com \
    --cc=nod.helm@gmail.com \
    --cc=peff@peff.net \
    --cc=prohaska@zib.de \
    --cc=sschuberth@gmail.com \
    --cc=techlivezheng@gmail.com \
    --cc=th.acker@arcor.de \
    /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).