1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-08 05:26:11 +02:00

Merge branch 'sd/branch-copy'

Code clean-up.

* sd/branch-copy:
  config: avoid "write_in_full(fd, buf, len) != len" pattern
This commit is contained in:
Junio C Hamano 2017-11-27 11:06:35 +09:00
commit 6254330e4d

View File

@ -2824,7 +2824,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
* 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));
goto out;
}
@ -2886,7 +2886,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
* 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));
goto out;
}