Skip to content

Commit 74d6c9d

Browse files
committed
Merge branch 'sd/branch-copy' into maint
Code clean-up. * sd/branch-copy: config: avoid "write_in_full(fd, buf, len) != len" pattern
2 parents 0114a7a + c5e3bc6 commit 74d6c9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
28112811
* multiple [branch "$name"] sections.
28122812
*/
28132813
if (copystr.len > 0) {
2814-
if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
2814+
if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
28152815
ret = write_error(get_lock_file_path(lock));
28162816
goto out;
28172817
}
@@ -2873,7 +2873,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
28732873
* logic in the loop above.
28742874
*/
28752875
if (copystr.len > 0) {
2876-
if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
2876+
if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
28772877
ret = write_error(get_lock_file_path(lock));
28782878
goto out;
28792879
}

0 commit comments

Comments
 (0)