From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: git@vger.kernel.org
Cc: Neil Horman <nhorman@tuxdriver.com>,
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Subject: [PATCH] add test for 'git rebase --keep-empty'
Date: Wed, 8 Aug 2012 09:48:18 -0700 [thread overview]
Message-ID: <1344444498-29328-1-git-send-email-martin.von.zweigbergk@gmail.com> (raw)
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---
While trying to use patch-id instead of
--ignore-if-in-upstream/--cherry-pick/cherry/etc, I noticed that
patch-id ignores empty patches and I was surprised that tests still
pass. This test case would be useful to protect --keep-empty.
t/t3401-rebase-partial.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh
index 7f8693b..b89b512 100755
--- a/t/t3401-rebase-partial.sh
+++ b/t/t3401-rebase-partial.sh
@@ -47,7 +47,14 @@ test_expect_success 'rebase ignores empty commit' '
git commit --allow-empty -m empty &&
test_commit D &&
git rebase C &&
- test $(git log --format=%s C..) = "D"
+ test "$(git log --format=%s C..)" = "D"
+'
+
+test_expect_success 'rebase --keep-empty' '
+ git reset --hard D &&
+ git rebase --keep-empty C &&
+ test "$(git log --format=%s C..)" = "D
+empty"
'
test_done
--
1.7.11.1.104.ge7b44f1
next reply other threads:[~2012-08-08 16:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 16:48 Martin von Zweigbergk [this message]
2012-08-08 16:59 ` [PATCH] add test for 'git rebase --keep-empty' Neil Horman
2012-08-09 15:39 ` [PATCH v2] add tests " Martin von Zweigbergk
2012-08-09 17:22 ` Junio C Hamano
2012-08-10 13:26 ` Neil Horman
2012-08-10 15:01 ` Joachim Schmitz
2012-08-10 16:20 ` Porting to a new platform Junio C Hamano
2012-08-10 16:59 ` Joachim Schmitz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344444498-29328-1-git-send-email-martin.von.zweigbergk@gmail.com \
--to=martin.von.zweigbergk@gmail.com \
--cc=git@vger.kernel.org \
--cc=nhorman@tuxdriver.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.
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 NNTP newsgroup(s).