Code

Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2009 16:23:43 +0000 (09:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2009 16:23:43 +0000 (09:23 -0700)
* mh/maint-fix-send-email-threaded:
  doc/send-email: clarify the behavior of --in-reply-to with --no-thread
  send-email: fix non-threaded mails
  add a test for git-send-email for non-threaded mails

Conflicts:
git-send-email.perl
t/t9001-send-email.sh

1  2 
Documentation/git-send-email.txt
git-send-email.perl
t/t9001-send-email.sh

Simple merge
index 4a77d445cd5e7c8ffe894da429b7e63ed7aabe8f,5d5169707b452836f3835069e4b015c45d3618af..303e03a8ce4031a1d9d6d00cb67abda1c30a63f3
@@@ -1147,10 -1134,10 +1147,10 @@@ foreach my $t (@files) 
  
        @cc = (@initial_cc, @cc);
  
 -      send_message();
 +      my $message_was_sent = send_message();
  
        # set up for the next message
-       if ($message_was_sent &&
 -      if ($thread &&
++      if ($thread && $message_was_sent &&
                ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
                $reply_to = $message_id;
                if (length $references > 0) {
index 8ab1a78bf59e063ca57bcee0bbf26edba0bec9ce,8518acaca6ea01723bd2a2e36c90cae23f6fbdcb..9ce04fd47277e1641979eb583a95de41e2f75570
@@@ -621,15 -621,14 +621,25 @@@ test_expect_success 'in-reply-to but n
        grep "In-Reply-To: <in-reply-id@example.com>"
  '
  
+ test_expect_success 'no in-reply-to and no threading' '
+       git send-email \
+               --dry-run \
+               --from="Example <nobody@example.com>" \
+               --to=nobody@example.com \
+               --nothread \
+               $patches $patches >stdout &&
+       ! grep "In-Reply-To: " stdout
+ '
 +test_expect_success 'threading but no chain-reply-to' '
 +      git send-email \
 +              --dry-run \
 +              --from="Example <nobody@example.com>" \
 +              --to=nobody@example.com \
 +              --thread \
 +              --nochain-reply-to \
 +              $patches $patches >stdout &&
 +      grep "In-Reply-To: " stdout
 +'
 +
  test_done