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

[PATCH] add test for 'git rebase --keep-empty'

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Aug 8, 2012, 16:48 UTC
Message-ID
<1344444498-29328-1-git-send-email-martin.von.zweigbergk@gmail.com>
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: Neil Horman
Message 1 of 8 in “add test for 'git rebase --keep-empty'”
  1. add test for 'git rebase --keep-empty'Martin von Zweigbergk, Aug 8, 2012
  2. Neil HormanAug 8, 2012
  3. add tests for 'git rebase --keep-empty'Martin von Zweigbergk, Aug 9, 2012
  4. Junio C HamanoAug 9, 2012
  5. Neil HormanAug 10, 2012
  6. Joachim SchmitzAug 10, 2012
  7. Porting to a new platformJunio C Hamano, Aug 10, 2012
  8. Joachim SchmitzAug 10, 2012

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.