Re: [PATCH 12/15] use get_commit_buffer everywhere
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2014, 22:40 UTC
- Message-ID
- <xmqqbnu1emfa.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140609181323.GL20315@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> diff --git a/notes-merge.c b/notes-merge.c > index 94a1a8a..7885ab2 100644 > --- a/notes-merge.c > +++ b/notes-merge.c > @@ -671,7 +671,8 @@ int notes_merge_commit(struct notes_merge_options *o, > DIR *dir; > struct dirent *e; > struct strbuf path = STRBUF_INIT; > - char *msg = strstr(partial_commit->buffer, "\n\n"); > + const char *buffer = get_commit_buffer(partial_commit); > + const char *msg = strstr(buffer, "\n\n");
This tightening causes...
Show 7 quoted lines
> struct strbuf sb_msg = STRBUF_INIT; > int baselen; > > @@ -720,6 +721,7 @@ int notes_merge_commit(struct notes_merge_options *o, > } > > strbuf_attach(&sb_msg, msg, strlen(msg), strlen(msg) + 1);
...a new error here:
notes-merge.c:723:2: error: passing argument 2 of 'strbuf_attach' discards 'const' qualifier from pointer target type [-Werror] strbuf.h:19:13: note: expected 'void *' but argument is of type 'const char *'