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
@@@ -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) {
@@@ -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