summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f871c6)
raw | patch | inline | side by side (parent: 7f871c6)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 1 Dec 2008 06:38:20 +0000 (22:38 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 1 Dec 2008 06:38:20 +0000 (22:38 -0800) |
The loop picks elements from @ARGV one by one, sifts them into arguments
meant for format-patch and the script itself, and pushes them to @files
and @rev_list_opts arrays. Pick elements from @ARGV starting at the
beginning using shift, instead of at the end using pop, as push appends
them to the end of the array.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
meant for format-patch and the script itself, and pushes them to @files
and @rev_list_opts arrays. Pick elements from @ARGV starting at the
beginning using shift, instead of at the end using pop, as push appends
them to the end of the array.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl | patch | blob | history | |
t/t9001-send-email.sh | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index 7508f8ff242854462d0b5b505621dd840b551641..3112f769cd4b86cbb87fbbb14b5a9d8c4b5fc6bd 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
# 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 617e97d963dc4a9c794fbb148ac4022b2d4fff65..cb3d1837709fbce30fc508e339ce671c55eb9a1b 100755 (executable)
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
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