Skip to content

Commit 3f83594

Browse files
committed
Merge branch 'tr/merge-recursive-flush' into maint-1.7.11
* tr/merge-recursive-flush: merge-recursive: eliminate flush_buffer() in favor of write_in_full()
2 parents d8ce800 + f633ea2 commit 3f83594

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

merge-recursive.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -614,23 +614,6 @@ static char *unique_path(struct merge_options *o, const char *path, const char *
614614
return newpath;
615615
}
616616

617-
static void flush_buffer(int fd, const char *buf, unsigned long size)
618-
{
619-
while (size > 0) {
620-
long ret = write_in_full(fd, buf, size);
621-
if (ret < 0) {
622-
/* Ignore epipe */
623-
if (errno == EPIPE)
624-
break;
625-
die_errno("merge-recursive");
626-
} else if (!ret) {
627-
die("merge-recursive: disk full?");
628-
}
629-
size -= ret;
630-
buf += ret;
631-
}
632-
}
633-
634617
static int dir_in_way(const char *path, int check_working_copy)
635618
{
636619
int pos, pathlen = strlen(path);
@@ -789,7 +772,7 @@ static void update_file_flags(struct merge_options *o,
789772
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
790773
if (fd < 0)
791774
die_errno("failed to open '%s'", path);
792-
flush_buffer(fd, buf, size);
775+
write_in_full(fd, buf, size);
793776
close(fd);
794777
} else if (S_ISLNK(mode)) {
795778
char *lnk = xmemdupz(buf, size);

0 commit comments

Comments
 (0)