summaryrefslogtreecommitdiff
path: root/builtin/merge-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-22 20:28:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-02-22 20:28:25 (GMT)
commitf11f76b2bbcd23fe403744c055456a0bdf0981e7 (patch)
treebbcf114146443e2f5d5d79ec8ed5ce160e5aab8a /builtin/merge-file.c
parent073bb8ebb8f6213080162ac5632ba853d2e8cceb (diff)
parent204a8ffe67d2b789a34a14a06618a24756f7d9a9 (diff)
downloadgit-f11f76b2bbcd23fe403744c055456a0bdf0981e7.zip
git-f11f76b2bbcd23fe403744c055456a0bdf0981e7.tar.gz
git-f11f76b2bbcd23fe403744c055456a0bdf0981e7.tar.bz2
Merge branch 'ab/merge-file-prefix'
"git merge-file" did not work correctly in a subdirectory. * ab/merge-file-prefix: merge-file: correctly open files when in a subdir
Diffstat (limited to 'builtin/merge-file.c')
-rw-r--r--builtin/merge-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index 131edc2..ea8093f 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -90,7 +90,8 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
if (ret >= 0) {
const char *filename = argv[0];
- FILE *f = to_stdout ? stdout : fopen(filename, "wb");
+ const char *fpath = prefix_filename(prefix, prefixlen, argv[0]);
+ FILE *f = to_stdout ? stdout : fopen(fpath, "wb");
if (!f)
ret = error("Could not open %s for writing", filename);