From 6851162adf29762cd121555645214468451a3111 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 17 Dec 2007 07:43:59 -0500 Subject: [PATCH 1/2] clone: correctly report http_fetch errors The exit status from curl was accidentally lost by the 'case' statement. We need to explicitly save it so that $? doesn't get overwritten. This improves the error message when fetching from an http repository which has never had update-server-info run. Previously, it would fail to note the fetch error and produce multiple errors about the lack of origin branches. It now correctly suggests running git-update-server-info. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-clone.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index 0ea3c24f59..036a37e85c 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -35,11 +35,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 () { From 4f3d37035a7c735a3b69f962656819f4ff7e4927 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 17 Dec 2007 15:51:34 -0500 Subject: [PATCH 2/2] git-send-email: avoid duplicate message-ids We used to unconditionally add a message-id to the outgoing email without bothering to check if it already had one. Instead, let's use the existing one. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-send-email.perl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git-send-email.perl b/git-send-email.perl index b03297c9d7..e8354c760b 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -527,7 +527,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} @@ -643,6 +643,9 @@ foreach my $t (@files) { } push @xh, $_; } + elsif (/^Message-Id: (.*)/i) { + $message_id = $1; + } elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) { push @xh, $_; } @@ -728,6 +731,7 @@ foreach my $t (@files) { $references = "$message_id"; } } + $message_id = undef; } if ($compose) {