Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Dec 2007 04:49:42 +0000 (20:49 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Dec 2007 04:49:42 +0000 (20:49 -0800)
* maint:
git-send-email: avoid duplicate message-ids
clone: correctly report http_fetch errors

git-clone.sh
git-send-email.perl
index 68085a3225cb0047ab3c5764472d3d024e467160..9a160eea525abae3c27e18217411f0d5f6c69399 100755 (executable)
@@ -56,11 +56,12 @@ fi
 
 http_fetch () {
        # $1 = Remote, $2 = Local
-       curl -nsfL $curl_extra_args "$1" >"$2" ||
-               case $? in
-               126|127) exit ;;
-               *)       return $? ;;
-               esac
+       curl -nsfL $curl_extra_args "$1" >"$2"
+       curl_exit_status=$?
+       case $curl_exit_status in
+       126|127) exit ;;
+       *)       return $curl_exit_status ;;
+       esac
 }
 
 clone_dumb_http () {
index 1d6f46645328dc2520226aba532c4acb86f5ec32..248d0350880c17fdcf7cf92afc392bc05dc47825 100755 (executable)
@@ -580,7 +580,7 @@ sub send_message
                $ccline = "\nCc: $cc";
        }
        my $sanitized_sender = sanitize_address($sender);
-       make_message_id();
+       make_message_id() unless defined($message_id);
 
        my $header = "From: $sanitized_sender
 To: $to${ccline}
@@ -718,6 +718,9 @@ sub send_message
                                        }
                                        push @xh, $_;
                                }
+                               elsif (/^Message-Id: (.*)/i) {
+                                       $message_id = $1;
+                               }
                                elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
                                        push @xh, $_;
                                }
@@ -805,6 +808,7 @@ sub send_message
                        $references = "$message_id";
                }
        }
+       $message_id = undef;
 }
 
 if ($compose) {