mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 20:42:23 +00:00
Merge pull request #1438 from ethomson/checkout_stat
don't stat until the file is written
This commit is contained in:
commit
d2a4a54bf9
@ -666,11 +666,11 @@ static int buffer_to_file(
|
|||||||
giterr_set(GITERR_OS, "Could not write to '%s'", path);
|
giterr_set(GITERR_OS, "Could not write to '%s'", path);
|
||||||
(void)p_close(fd);
|
(void)p_close(fd);
|
||||||
} else {
|
} else {
|
||||||
if ((error = p_fstat(fd, st)) < 0)
|
|
||||||
giterr_set(GITERR_OS, "Error while statting '%s'", path);
|
|
||||||
|
|
||||||
if ((error = p_close(fd)) < 0)
|
if ((error = p_close(fd)) < 0)
|
||||||
giterr_set(GITERR_OS, "Error while closing '%s'", path);
|
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 &&
|
if (!error &&
|
||||||
|
Loading…
Reference in New Issue
Block a user