summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-06 09:09:01 -0800
committerJunio C Hamano <gitster@pobox.com>2017-12-06 09:09:01 -0800
commit74d6c9de9b89e56e641aff840b15e4a8fb291638 (patch)
tree7a1f87556470c4152511661fe97bb0d4c096ffc7
parent0114a7ad0664358f6f29b44461148f621520ed97 (diff)
parentc5e3bc6ec46071397b40582157214d374d1b4fab (diff)
downloadgit-74d6c9de9b89e56e641aff840b15e4a8fb291638.tar.gz
Merge branch 'sd/branch-copy' into maint
Code clean-up. * sd/branch-copy: config: avoid "write_in_full(fd, buf, len) != len" pattern
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index c38401a750..41862d4a32 100644
--- a/config.c
+++ b/config.c
@@ -2811,7 +2811,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;
}
@@ -2873,7 +2873,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;
}