summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-03-20 16:44:08 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2021-04-28 13:03:34 +0100
commit6b878db5e8f851b76ef19ffe724018cbe62b88bb (patch)
tree4418aa4c5938c9cb31716818740ab91482bfeeff
parent50e012163619a1808bb7e06e658f3d47a472f0d1 (diff)
downloadlibgit2-6b878db5e8f851b76ef19ffe724018cbe62b88bb.tar.gz
checkout: use target path; don't assume workdir
We're not necessarily checking out into the working directory. We could be checking out into an arbitrary location. Ensure that when we are writing conflict data that we do it in the checkout target.
-rw-r--r--src/checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c
index ba75839f7..ea1a35474 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -2032,7 +2032,7 @@ static int checkout_merge_path(
const char *our_label_raw, *their_label_raw, *suffix;
int error = 0;
- if ((error = git_buf_joinpath(out, git_repository_workdir(data->repo), result->path)) < 0)
+ if ((error = git_buf_joinpath(out, data->opts.target_directory, result->path)) < 0)
return error;
/* Most conflicts simply use the filename in the index */