[PATCH v2 2/7] notes-merge: drop dead zero-write code
- From
Jeff King <peff@peff.net>
- Date
- Sep 27, 2017, 06:00 UTC
- Message-ID
- <20170927060007.hcoesuhxqtwvdjj3@sigill.intra.peff.net>
- In-Reply-To
- <20170927055424.22ati3g24xaqtqrk@sigill.intra.peff.net>
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> --- notes-merge.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/notes-merge.c b/notes-merge.c index 597d43f65c..4352c34a6e 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -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;
-- 2.14.2.988.g01c8b37dde