Merge branch 'sb/t1020-cleanup'
[gitweb.git] / builtin / merge-file.c
index 844f84f40bf0f8b9d95f4e9f0496c010386a9fb8..ea8093f6769e278c4f7871faf405fe1e3f0a7544 100644 (file)
@@ -5,7 +5,7 @@
 #include "parse-options.h"
 
 static const char *const merge_file_usage[] = {
-       N_("git merge-file [options] [-L name1 [-L orig [-L name2]]] file1 orig_file file2"),
+       N_("git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> <orig-file> <file2>"),
        NULL
 };
 
@@ -42,7 +42,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
                            N_("for conflicts, use this marker size")),
                OPT__QUIET(&quiet, N_("do not warn about conflicts")),
                OPT_CALLBACK('L', NULL, names, N_("name"),
-                            N_("set labels for file1/orig_file/file2"), &label_cb),
+                            N_("set labels for file1/orig-file/file2"), &label_cb),
                OPT_END(),
        };
 
@@ -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);