From 22c7878655a61e38b9a60bb3b8a56a8343dd48a8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Tue, 21 Apr 2015 10:53:31 +0100 Subject: [PATCH] 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. --- src/backend/git.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/git.cpp b/src/backend/git.cpp index 6f3207f1..7f1a9113 100644 --- a/src/backend/git.cpp +++ b/src/backend/git.cpp @@ -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;