Skip to content

Commit 77e565d

Browse files
matledJunio C Hamano
authored andcommitted
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>
1 parent a283837 commit 77e565d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtin-log.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
270270

271271
rev.extra_headers = extra_headers;
272272

273-
output_directory = prefix;
274-
275273
/*
276274
* Parse the arguments before setup_revisions(), or something
277275
* 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)
350348
if (!rev.diffopt.output_format)
351349
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
352350

351+
if (!output_directory)
352+
output_directory = prefix;
353+
353354
if (output_directory) {
354355
if (use_stdout)
355356
die("standard output, or directory, which one?");

0 commit comments

Comments
 (0)