From: Junio C Hamano Date: Mon, 27 Nov 2017 02:06:35 +0000 (+0900) Subject: Merge branch 'sd/branch-copy' X-Git-Tag: v2.16.0-rc0~100 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6254330e4d075be1fdbef0349b40562d25157b6e Merge branch 'sd/branch-copy' Code clean-up. * sd/branch-copy: config: avoid "write_in_full(fd, buf, len) != len" pattern --- 6254330e4d075be1fdbef0349b40562d25157b6e diff --cc config.c index 03ab56d3d8,4457aec089..731b9b1de2 --- a/config.c +++ b/config.c @@@ -2824,8 -2700,8 +2824,8 @@@ static int git_config_copy_or_rename_se * multiple [branch "$name"] sections. */ if (copystr.len > 0) { - if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) { + if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) { - ret = write_error(get_lock_file_path(lock)); + ret = write_error(get_lock_file_path(&lock)); goto out; } strbuf_reset(©str); @@@ -2886,8 -2763,8 +2886,8 @@@ * logic in the loop above. */ if (copystr.len > 0) { - if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) { + if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) { - ret = write_error(get_lock_file_path(lock)); + ret = write_error(get_lock_file_path(&lock)); goto out; } strbuf_reset(©str);