Try to fix repository parent path symlink issue.

For issue #417. Apparently if there is a symlink somewhere in the
checkout location's parent path, libgit2 will try to remove that
symlink. Searching the code for the error message given points to the
GIT_CHECKOUT_DONT_REMOVE_EXISTING flag controlling this behaviour,
though it seems to be intended only for paths within the checkout
directory.
This commit is contained in:
Oliver Hamlet
2015-04-21 10:53:31 +01:00
parent 9a59b8bfa6
commit 22c7878655
+1 -1
View File
@@ -285,7 +285,7 @@ namespace loot {
char * paths = new char[filename.length() + 1];
strcpy(paths, filename.c_str());
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE;
checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE | GIT_CHECKOUT_DONT_REMOVE_EXISTING;
checkout_opts.paths.strings = &paths;
checkout_opts.paths.count = 1;