Commit d2a4a54b by Vicent Martí

Merge pull request #1438 from ethomson/checkout_stat

don't stat until the file is written
parents f2850f33 d828f118
......@@ -666,11 +666,11 @@ static int buffer_to_file(
giterr_set(GITERR_OS, "Could not write to '%s'", path);
(void)p_close(fd);
} else {
if ((error = p_fstat(fd, st)) < 0)
giterr_set(GITERR_OS, "Error while statting '%s'", path);
if ((error = p_close(fd)) < 0)
giterr_set(GITERR_OS, "Error while closing '%s'", path);
if ((error = p_stat(path, st)) < 0)
giterr_set(GITERR_OS, "Error while statting '%s'", path);
}
if (!error &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment