Commit ae6ba7f7 by nulltoken Committed by Vicent Marti

Fix gitfo_mv() behavior when running on Windows

When the system temporary folder is located on a different volume than the working directory into which libgit2 is executing, MoveFileEx() requires an additional flag.
parent 56d8ca26
...@@ -263,7 +263,7 @@ int gitfo_mv(const char *from, const char *to) ...@@ -263,7 +263,7 @@ int gitfo_mv(const char *from, const char *to)
* file exists, the `rename` call fails. This is as * file exists, the `rename` call fails. This is as
* close as it gets with the Win32 API. * close as it gets with the Win32 API.
*/ */
return MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING) ? GIT_SUCCESS : GIT_EOSERR; return MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED) ? GIT_SUCCESS : GIT_EOSERR;
#else #else
/* Don't even try this on Win32 */ /* Don't even try this on Win32 */
if (!link(from, to)) { if (!link(from, to)) {
......
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