Merge branch 'km/send-email-with-v-reroll-count'
"git send-email -v 3" used to be expanded to "git send-email --validate 3" when the user meant to pass them down to "format-patch", which has been corrected. * km/send-email-with-v-reroll-count: send-email: relay '-v N' to format-patch
This commit is contained in:
@ -220,6 +220,10 @@ my $compose_filename;
|
||||
my $force = 0;
|
||||
my $dump_aliases = 0;
|
||||
|
||||
# Variables to prevent short format-patch options from being captured
|
||||
# as abbreviated send-email options
|
||||
my $reroll_count;
|
||||
|
||||
# Handle interactive edition of files.
|
||||
my $multiedit;
|
||||
my $editor;
|
||||
@ -542,6 +546,7 @@ my %options = (
|
||||
"batch-size=i" => \$batch_size,
|
||||
"relogin-delay=i" => \$relogin_delay,
|
||||
"git-completion-helper" => \$git_completion_helper,
|
||||
"v=s" => \$reroll_count,
|
||||
);
|
||||
$rc = GetOptions(%options);
|
||||
|
||||
@ -782,7 +787,9 @@ if (@rev_list_opts) {
|
||||
die __("Cannot run git format-patch from outside a repository\n")
|
||||
unless $repo;
|
||||
require File::Temp;
|
||||
push @files, $repo->command('format-patch', '-o', File::Temp::tempdir(CLEANUP => 1), @rev_list_opts);
|
||||
push @files, $repo->command('format-patch', '-o', File::Temp::tempdir(CLEANUP => 1),
|
||||
defined $reroll_count ? ('-v', $reroll_count) : (),
|
||||
@rev_list_opts);
|
||||
}
|
||||
|
||||
@files = handle_backup_files(@files);
|
||||
|
@ -2334,6 +2334,12 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
|
||||
"$(pwd)/0001-add-main.patch"
|
||||
'
|
||||
|
||||
test_expect_success $PREREQ 'send-email relays -v 3 to format-patch' '
|
||||
test_when_finished "rm -f out" &&
|
||||
git send-email --dry-run -v 3 -1 >out &&
|
||||
grep "PATCH v3" out
|
||||
'
|
||||
|
||||
test_expect_success $PREREQ 'test that sendmail config is rejected' '
|
||||
test_config sendmail.program sendmail &&
|
||||
test_must_fail git send-email \
|
||||
|
Reference in New Issue
Block a user