Re: [RFC PATCH v3 07/12] notes: implement helpers needed for note copying during rewrite
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 21, 2010, 03:34 UTC
- Message-ID
- <7v3a0v45yc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <9f4cb8a577e853378c1d3136b54a5e73ac29dc22.1266703765.git.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 11 quoted lines
> +combine_notes_fn *parse_combine_notes_fn(const char *v)
> +{
> + if (!strcasecmp(v, "overwrite"))
> + return combine_notes_overwrite;
> + else if (!strcasecmp(v, "ignore"))
> + return combine_notes_ignore;
> + else if (!strcasecmp(v, "concatenate"))
> + return combine_notes_concatenate;
> + else
> + return NULL;
> +}Somebody in the call chain should have made sure v != NULL and called config_error_nonbool() if v is NULL.
Show 29 quoted lines
> diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh > index 634d213..5a0dccd 100755 > --- a/t/t3301-notes.sh > +++ b/t/t3301-notes.sh > @@ -684,6 +684,7 @@ test_expect_success 'cannot copy note from object without notes' ' > ' > > cat > expect << EOF > +commit e5d4fb5698d564ab8c73551538ecaf2b0c666185 > Author: A U Thor <author@example.com> > Date: Thu Apr 7 15:25:13 2005 -0700 > > @@ -694,6 +695,7 @@ Notes from notes/other: > $whitespace > yet another note > > +commit 7038787dfe22a14c3867ce816dbba39845359719 > Author: A U Thor <author@example.com> > Date: Thu Apr 7 15:24:13 2005 -0700 > > @@ -710,9 +712,123 @@ test_expect_success 'git notes copy --stdin' ' > echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) | > git notes copy --stdin && > git log -2 > output && > - strip_then_cmp expect output && > + test_cmp expect output && > test "$(git notes list HEAD)" = "$(git notes list HEAD~2)" && > test "$(git notes list HEAD^)" = "$(git notes list HEAD~3)" > '
I think the above piece should have been squashed to the previous patch.