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, 03:42 UTC
Message-ID
<1194234165-9498-1-git-send-email-krh@redhat.com>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
 t/t7501-commit.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index b151b51..7a37c13 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -151,6 +151,7 @@ test_expect_success 'partial commit that involves removal (2)' '
 	diff expected current
 
 '
+test_tick
 
 test_expect_success 'partial commit that involves removal (3)' '
 
@@ -163,4 +164,19 @@ test_expect_success 'partial commit that involves removal (3)' '
 
 '
 
+oldtick=$GIT_AUTHOR_DATE
+test_tick
+
+author="The Real Author <someguy@his.email.org>"
+committer="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE"
+
+test_expect_success 'amend commit to fix author' '
+
+	git reset --hard
+	git cat-file -p HEAD | sed -e "s/author.*/author $author $oldtick/" -e "s/committer.*/committer $committer/" > expected &&
+	git commit --amend --author="$author" &&
+	git cat-file -p HEAD > current &&
+	diff expected current
+	
+'
 test_done
-- 
1.5.3.5.1527.g6161-dirty
Next: Johannes Schindelin
Message 1 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.