X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=rerere.c;h=d84b495895bc6d42980c388ed03c560174604f92;hb=dc4a1ba99c968d71ebe27c05c5a600e6df74e408;hp=d55aa8a01b4a4f200f24972795f2887644a06d43;hpb=ed5d0d2105c84ec40dd7526c9cd20e4587c62987;p=thirdparty%2Fgit.git diff --git a/rerere.c b/rerere.c index d55aa8a01b..d84b495895 100644 --- a/rerere.c +++ b/rerere.c @@ -207,11 +207,11 @@ static int handle_path(unsigned char *sha1, struct rerere_io *io, int marker_siz strbuf_reset(&one); strbuf_reset(&two); } else if (hunk == RR_SIDE_1) - strbuf_addstr(&one, buf.buf); + strbuf_addbuf(&one, &buf); else if (hunk == RR_ORIGINAL) ; /* discard */ else if (hunk == RR_SIDE_2) - strbuf_addstr(&two, buf.buf); + strbuf_addbuf(&two, &buf); else rerere_io_putstr(buf.buf, io); continue; @@ -492,8 +492,7 @@ static int update_paths(struct string_list *update) } if (!status && active_cache_changed) { - if (write_cache(fd, active_cache, active_nr) || - commit_locked_index(&index_lock)) + if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK)) die("Unable to write new index file"); } else if (fd >= 0) rollback_lock_file(&index_lock);