git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabian Ruch <bafain@gmail.com>
To: git@vger.kernel.org
Cc: Erick Mattos <erick.mattos@gmail.com>,
	Michael Haggerty <mhagger@alum.mit.edu>,
	Thomas Rast <tr@thomasrast.ch>, Jeff King <peff@peff.net>
Subject: [PATCH] commit --amend: test specifies authorship but forgets to check
Date: Wed, 30 Jul 2014 11:45:11 +0200	[thread overview]
Message-ID: <0ba2fcaf784bb74ee5a9f8d13dce64ab09e66d7b.1406713446.git.bafain@gmail.com> (raw)

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

             reply	other threads:[~2014-07-30  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  9:45 Fabian Ruch [this message]
2014-07-30 19:44 ` [PATCH] commit --amend: test specifies authorship but forgets to check Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ba2fcaf784bb74ee5a9f8d13dce64ab09e66d7b.1406713446.git.bafain@gmail.com \
    --to=bafain@gmail.com \
    --cc=erick.mattos@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    --cc=peff@peff.net \
    --cc=tr@thomasrast.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).