Skip to content

Commit 6254330

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

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
@@ -2824,7 +2824,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
28242824
* multiple [branch "$name"] sections.
28252825
*/
28262826
if (copystr.len > 0) {
2827-
if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
2827+
if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
28282828
ret = write_error(get_lock_file_path(&lock));
28292829
goto out;
28302830
}
@@ -2886,7 +2886,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
28862886
* logic in the loop above.
28872887
*/
28882888
if (copystr.len > 0) {
2889-
if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
2889+
if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
28902890
ret = write_error(get_lock_file_path(&lock));
28912891
goto out;
28922892
}

0 commit comments

Comments
 (0)