notes-merge: drop dead zero-write code
authorJeff King <peff@peff.net>
Mon, 25 Sep 2017 20:27:57 +0000 (16:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Sep 2017 03:55:59 +0000 (12:55 +0900)
We call write_in_full() with a size that we know is greater
than zero. The return value can never be zero, then, since
write_in_full() converts such a failed write() into ENOSPC
and returns -1.  We can just drop this branch of the error
handling entirely.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes-merge.c

index 597d43f..4352c34 100644 (file)
@@ -308,8 +308,6 @@ static void write_buf_to_worktree(const struct object_id *obj,
                        if (errno == EPIPE)
                                break;
                        die_errno("notes-merge");
-               } else if (!ret) {
-                       die("notes-merge: disk full?");
                }
                size -= ret;
                buf += ret;