Skip to content

Commit

Permalink
fileops: set an error on write error for file copy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carlosmn committed Jun 22, 2015
1 parent 9e74954 commit c760654
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fileops.c
Expand Up @@ -664,6 +664,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);
Expand Down

0 comments on commit c760654

Please sign in to comment.