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

[PATCH] t7501-commit.sh: Add test case for fixing author in amend commit.

From
Kristian Høgsberg <krh@redhat.com>
Date
Nov 5, 2007, 17:17 UTC
Message-ID
<1194283047-16565-1-git-send-email-krh@redhat.com>
In-Reply-To
<Pine.LNX.4.64.0711051020330.4362@racer.site>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
How about this?
 t/t7501-commit.sh |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index b151b51..c5d122f 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -163,4 +163,19 @@ test_expect_success 'partial commit that involves removal (3)' '
 
 '
 
+author="The Real Author <someguy@his.email.org>"
+test_expect_success 'amend commit to fix author' '
+
+	oldtick=$GIT_AUTHOR_DATE &&
+	test_tick &&
+	git reset --hard &&
+	git cat-file -p HEAD |
+	sed -e "s/author.*/author $author $oldtick/" \
+		-e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
+		expected &&
+	git commit --amend --author="$author" &&
+	git cat-file -p HEAD > current &&
+	diff expected current
+	
+'
 test_done
-- 
1.5.3.4
Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 4 in “t7501-commit.sh: Add test case for fixing author in amend commit.”
  1. t7501-commit.sh: Add test case for fixing author in amend commit.Kristian Høgsberg, Nov 5, 2007
  2. Johannes SchindelinNov 5, 2007
  3. t7501-commit.sh: Add test case for fixing author in amend commit.Kristian Høgsberg, Nov 5, 2007
  4. Junio C HamanoNov 5, 2007

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.