aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-send-email.perl2
-rwxr-xr-xt/t9001-send-email.sh13
2 files changed, 14 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 7508f8ff2..3112f769c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -421,7 +421,7 @@ EOF
# Now that all the defaults are set, process the rest of the command line
# arguments and collect up the files that need to be processed.
my @rev_list_opts;
-while (my $f = pop @ARGV) {
+while (defined(my $f = shift @ARGV)) {
if ($f eq "--") {
push @rev_list_opts, "--", @ARGV;
@ARGV = ();
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 617e97d96..cb3d18377 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -300,4 +300,17 @@ test_expect_success 'detects ambiguous reference/file conflict' '
grep disambiguate errors
'
+test_expect_success 'feed two files' '
+ rm -fr outdir &&
+ git format-patch -2 -o outdir &&
+ GIT_SEND_EMAIL_NOTTY=1 git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ outdir/000?-*.patch 2>errors >out &&
+ grep "^Subject: " out >subjects &&
+ test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." &&
+ test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
+'
+
test_done