git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] commit --amend: test specifies authorship but forgets to check
@ 2014-07-30  9:45 Fabian Ruch
  2014-07-30 19:44 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ruch @ 2014-07-30  9:45 UTC (permalink / raw)
  To: git; +Cc: Erick Mattos, Michael Haggerty, Thomas Rast, Jeff King

The test case "--amend option copies authorship" specifies that the
git-commit option `--amend` uses the authorship of the replaced
commit for the new commit. Add the omitted check that this property
actually holds.

Signed-off-by: Fabian Ruch <bafain@gmail.com>
---
Without the check, the test case succeeds even with nonsense in the
`expected` file. An `--amend` implementation which simply uses the
committer name and date as if it was not amending would have been
deemed correct. This is not the case, the implementation still passes
the test suite after the correction.

Quickly skimming over the rest of the file, I couldn't find the same
thing twice.

 t/t7509-commit.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t7509-commit.sh b/t/t7509-commit.sh
index b61fd3c..9ac7940 100755
--- a/t/t7509-commit.sh
+++ b/t/t7509-commit.sh
@@ -77,6 +77,7 @@ test_expect_success '--amend option copies authorship' '
 	git commit -a --amend -m "amend test" &&
 	author_header Initial >expect &&
 	author_header HEAD >actual &&
+	test_cmp expect actual &&
 
 	echo "amend test" >expect &&
 	message_body HEAD >actual &&
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-30 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  9:45 [PATCH] commit --amend: test specifies authorship but forgets to check Fabian Ruch
2014-07-30 19:44 ` Junio C Hamano

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).