diff options
-rw-r--r-- | builtin-log.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-log.c b/builtin-log.c index 130b53a19..9d1ceae44 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -270,8 +270,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.extra_headers = extra_headers; - output_directory = prefix; - /* * Parse the arguments before setup_revisions(), or something * like "git fmt-patch -o a123 HEAD^.." may fail; a123 is @@ -350,6 +348,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (!rev.diffopt.output_format) rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH; + if (!output_directory) + output_directory = prefix; + if (output_directory) { if (use_stdout) die("standard output, or directory, which one?"); |