summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-09-14 11:53:53 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-14 11:53:53 -0700
commit8c11b25de41857e5a44325046dd55d3751f740c6 (patch)
tree066d739a7361b0341b84ad19ad0d62ad04c1f366 /merge-recursive.c
parentMerge branch 'rj/tap-fix' (diff)
parentCall mkpathdup() rather than xstrdup(mkpath(...)) (diff)
downloadtgif-8c11b25de41857e5a44325046dd55d3751f740c6.tar.xz
Merge branch 'rj/path-cleanup'
* rj/path-cleanup: Call mkpathdup() rather than xstrdup(mkpath(...)) Call git_pathdup() rather than xstrdup(git_path("...")) path.c: Use vsnpath() in the implementation of git_path() path.c: Don't discard the return value of vsnpath() path.c: Remove the 'git_' prefix from a file scope function
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 7866ca1026..d8820604ca 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -844,14 +844,14 @@ static int merge_3way(struct merge_options *o,
if (strcmp(a->path, b->path) ||
(o->ancestor != NULL && strcmp(a->path, one->path) != 0)) {
base_name = o->ancestor == NULL ? NULL :
- xstrdup(mkpath("%s:%s", o->ancestor, one->path));
- name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
- name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
+ mkpathdup("%s:%s", o->ancestor, one->path);
+ name1 = mkpathdup("%s:%s", branch1, a->path);
+ name2 = mkpathdup("%s:%s", branch2, b->path);
} else {
base_name = o->ancestor == NULL ? NULL :
- xstrdup(mkpath("%s", o->ancestor));
- name1 = xstrdup(mkpath("%s", branch1));
- name2 = xstrdup(mkpath("%s", branch2));
+ mkpathdup("%s", o->ancestor);
+ name1 = mkpathdup("%s", branch1);
+ name2 = mkpathdup("%s", branch2);
}
read_mmblob(&orig, one->sha1);
@@ -861,6 +861,7 @@ static int merge_3way(struct merge_options *o,
merge_status = ll_merge(result_buf, a->path, &orig, base_name,
&src1, name1, &src2, name2, &ll_opts);
+ free(base_name);
free(name1);
free(name2);
free(orig.ptr);