summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3531e27)
raw | patch | inline | side by side (parent: 3531e27)
author | Jay Soffian <jaysoffian@gmail.com> | |
Mon, 23 Feb 2009 18:51:37 +0000 (13:51 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 24 Feb 2009 06:03:50 +0000 (22:03 -0800) |
Commit eed6ca7 caused a minor regression when it switched to using
tempfile() to generate the temporary compose file. Since tempfile()
creates the file at the time it generates the filename, zero-length
temporary files are being left behind unless --compose is used (in which
case the file is cleaned up).
This patch fixes the regression by not calling tempfile() to generate
the compose filename unless --compose is in use.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tempfile() to generate the temporary compose file. Since tempfile()
creates the file at the time it generates the filename, zero-length
temporary files are being left behind unless --compose is used (in which
case the file is cleaned up).
This patch fixes the regression by not calling tempfile() to generate
the compose filename unless --compose is in use.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index 54e76173f94e2b869ea49341bde8f06739d0d283..adf7ecb5c35a978bad5a15463cb9cf54665b9860 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
# Behavior modification variables
my ($quiet, $dry_run) = (0, 0);
my $format_patch;
-my $compose_filename = ($repo ?
- tempfile(".gitsendemail.msg.XXXXXX", DIR => $repo->repo_path()) :
- tempfile(".gitsendemail.msg.XXXXXX", DIR => "."))[1];
-
+my $compose_filename;
# Handle interactive edition of files.
my $multiedit;
system "stty echo";
# tmp files from --compose
- if (-e $compose_filename) {
- print "'$compose_filename' contains an intermediate version of the email you were composing.\n";
- }
- if (-e ($compose_filename . ".final")) {
- print "'$compose_filename.final' contains the composed email.\n"
+ if (defined $compose_filename) {
+ if (-e $compose_filename) {
+ print "'$compose_filename' contains an intermediate version of the email you were composing.\n";
+ }
+ if (-e ($compose_filename . ".final")) {
+ print "'$compose_filename.final' contains the composed email.\n"
+ }
}
exit;
if ($compose) {
# Note that this does not need to be secure, but we will make a small
# effort to have it be unique
+ $compose_filename = ($repo ?
+ tempfile(".gitsendemail.msg.XXXXXX", DIR => $repo->repo_path()) :
+ tempfile(".gitsendemail.msg.XXXXXX", DIR => "."))[1];
open(C,">",$compose_filename)
or die "Failed to open for writing $compose_filename: $!";