public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Fabian Ruch <bafain@gmail•com>
Cc: git@vger•kernel.org, Erick Mattos <erick.mattos@gmail•com>,
	Michael Haggerty <mhagger@alum•mit.edu>,
	Thomas Rast <tr@thomasrast•ch>, Jeff King <peff@peff•net>
Subject: Re: [PATCH] commit --amend: test specifies authorship but forgets to check
Date: Wed, 30 Jul 2014 12:44:30 -0700	[thread overview]
Message-ID: <xmqqppgmy6ld.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <0ba2fcaf784bb74ee5a9f8d13dce64ab09e66d7b.1406713446.git.bafain@gmail.com> (Fabian Ruch's message of "Wed, 30 Jul 2014 11:45:11 +0200")

Fabian Ruch <bafain@gmail•com> writes:

> 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 &&

Makes sense; thanks.

      reply	other threads:[~2014-07-30 19:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=xmqqppgmy6ld.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=bafain@gmail$(echo .)com \
    --cc=erick.mattos@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=mhagger@alum$(echo .)mit.edu \
    --cc=peff@peff$(echo .)net \
    --cc=tr@thomasrast$(echo .)ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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