format-patch: fix bug with --stdout in a subdirectory

We set the output directory to the git subdirectory prefix if one has
not already been specified. However, in the case of --stdout, we
explicitly _don't_ want the output directory to be set. The result was
that "git-format-patch --stdout" in a directory besides the project root
produced the "standard output, or directory, which one?" error message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jeff King 2007-01-22 22:38:28 -05:00 committed by Junio C Hamano
parent 83e24dce14
commit 90f70a910a

View File

@ -476,7 +476,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (!rev.diffopt.text)
rev.diffopt.binary = 1;
if (!output_directory)
if (!output_directory && !use_stdout)
output_directory = prefix;
if (output_directory) {