Re: [PATCH] git-format-patch: add --output-directory long option again
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 6, 2006, 14:53 UTC
- Message-ID
- <Pine.LNX.4.63.0606061650360.2063@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <20060606141946.G59b8a1fd@leonov.stosberg.net>
Hi,
what idiot wrote that part of the code originally? ;-)
On Tue, 6 Jun 2006, Dennis Stosberg wrote:
Show 13 quoted lines
> @@ -243,6 +241,12 @@ int cmd_format_patch(int argc, const cha
> if (argc > 1)
> die ("unrecognized argument: %s", argv[1]);
>
> + if (output_directory && !stdout) {
> + if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
> + die("Could not create directory %s",
> + output_directory);
> + }
> +
> if (rev.pending_objects && rev.pending_objects->next == NULL) {
> rev.pending_objects->item->flags |= UNINTERESTING;
> add_head(&rev);Would it not be better to
if (output_directory && stdout)
die("What do you want: stdout or a directory?");Ciao, Dscho