git-format-patch: fix bug using -o in subdirectories
This was introduced by me in commit v1.4.2.1-gc08e524. Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Matthias Lederhofer committed
Sep 28, 2006 at 21:55 UTC
77e565d8f76357781eb6236e031e8e0581de83a9
1 file changed
+3
-2
builtin-log.c
+3
-2
@@ -270,8 +270,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
270
271
rev.extra_headers = extra_headers;
272
273
- output_directory = prefix;
274
-
273
/*
274
* Parse the arguments before setup_revisions(), or something
275
* 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)
348
if (!rev.diffopt.output_format)
349
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
350
351
+ if (!output_directory)
352
+ output_directory = prefix;
353
+
354
if (output_directory) {
355
if (use_stdout)
356
die("standard output, or directory, which one?");