[PATCH 1/8] apply: reformat comment
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 10, 2012, 06:02 UTC
- Message-ID
- <1336629745-22436-2-git-send-email-gitster@pobox.com>
- In-Reply-To
- <1336629745-22436-1-git-send-email-gitster@pobox.com>
With the "--reject" option, apply_fragments() can return 0, while marking the fragment that was rejected as such, and there was a comment for that, but it was stated rather poorly.
Update the comment and enclose it in a block, as this part will be getting new code in later patches.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- builtin/apply.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/builtin/apply.c b/builtin/apply.c index 725712d..fc7f07b 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3066,8 +3066,10 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry * img = strbuf_detach(&buf, &len); prepare_image(&image, img, len, !patch->is_binary); - if (apply_fragments(&image, patch) < 0) - return -1; /* note with --reject this succeeds. */ + if (apply_fragments(&image, patch) < 0) { + /* Note: with --reject, the above call succeeds. */ + return -1; + } patch->result = image.buf; patch->resultsize = image.len; add_to_fn_table(patch);
-- 1.7.10.1.562.gfc79b1c