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

[PATCH 4/6] t3504: use test_commit

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
Aug 2, 2017, 10:44 UTC
Message-ID
<20170802104420.12809-5-phillip.wood@talktalk.net>
In-Reply-To
<20170802104420.12809-1-phillip.wood@talktalk.net>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

Using test_commit is simpler than chaining echo && git add && test_tick && commit. Also having tags makes it clearer which commit is being selecting by reset.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 t/t3504-cherry-pick-rerere.sh | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/t/t3504-cherry-pick-rerere.sh b/t/t3504-cherry-pick-rerere.sh
index e6a64816efef0e53018c7a56784d1af62602e9d3..33f902b1b0d8eb651e0e6857f8f5b86ef633ef4a 100755
--- a/t/t3504-cherry-pick-rerere.sh
+++ b/t/t3504-cherry-pick-rerere.sh
@@ -5,14 +5,11 @@ test_description='cherry-pick should rerere for conflicts'
 . ./test-lib.sh
 
 test_expect_success setup '
-	echo foo >foo &&
-	git add foo && test_tick && git commit -q -m 1 &&
-	echo foo-master >foo &&
-	git add foo && test_tick && git commit -q -m 2 &&
+	test_commit foo &&
+	test_commit foo-master foo &&
 
-	git checkout -b dev HEAD^ &&
-	echo foo-dev >foo &&
-	git add foo && test_tick && git commit -q -m 3 &&
+	git checkout -b dev foo &&
+	test_commit foo-dev foo &&
 	git config rerere.enabled true
 '
 
@@ -21,10 +18,10 @@ test_expect_success 'conflicting merge' '
 '
 
 test_expect_success 'fixup' '
-	echo foo-dev >foo &&
-	git add foo && test_tick && git commit -q -m 4 &&
-	git reset --hard HEAD^ &&
-	echo foo-dev >expect
+	echo foo-resolved >foo &&
+	git commit -am resolved &&
+	cp foo expect &&
+	git reset --hard HEAD^
 '
 
 test_expect_success 'cherry-pick conflict' '
-- 
2.13.3
Previous: Phillip Wood
Message 12 of 12 in “am/cherry-pick/rebase/revert --rerere-autoupdate fixes”
  1. 0/6 am/cherry-pick/rebase/revert --rerere-autoupdate fixesPhillip Wood, Aug 2, 2017
  2. 2/6 rebase: honor --rerere-autoupdatePhillip Wood, Aug 2, 2017
  3. 6/6 cherry-pick/revert: reject --rerere-autoupdate when continuingPhillip Wood, Aug 2, 2017
  4. Junio C HamanoAug 2, 2017
  5. Junio C HamanoAug 2, 2017
  6. Phillip WoodAug 3, 2017
  7. Junio C HamanoAug 3, 2017
  8. Phillip WoodAug 7, 2017
  9. 1/6 am: remember --rerere-autoupdate settingPhillip Wood, Aug 2, 2017
  10. 3/6 rebase -i: honor --rerere-autoupdatePhillip Wood, Aug 2, 2017
  11. 5/6 cherry-pick/revert: remember --rerere-autoupdatePhillip Wood, Aug 2, 2017
  12. 4/6 t3504: use test_commitPhillip Wood, Aug 2, 2017

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.