fileops: set an error on write error for file copy

We set an error if we get an error when reading, but we don't bother
setting an error message for write failing. This causes a cryptic error
to be shown to the user when the target filesystem is full.
This commit is contained in:
Carlos Martín Nieto 2015-05-15 12:23:27 +02:00
parent 54738368ec
commit edef91ee25

View File

@ -703,6 +703,9 @@ static int cp_by_fd(int ifd, int ofd, bool close_fd_when_done)
error = (int)len;
}
if (error < 0)
giterr_set(GITERR_OS, "write error while copying file");
if (close_fd_when_done) {
p_close(ifd);
p_close(ofd);