Git fork

Merge branch 'jk/http-push-status-fix'

"git push" client talking to an HTTP server did not diagnose the
lack of the final status report from the other side correctly,
which has been corrected.

* jk/http-push-status-fix:
transport-helper: recognize "expecting report" error from send-pack
send-pack: complain about "expecting report" with --helper-status

+35
+4
builtin/send-pack.c
··· 87 87 break; 88 88 89 89 case REF_STATUS_EXPECTING_REPORT: 90 + res = "error"; 91 + msg = "expecting report"; 92 + break; 93 + 90 94 default: 91 95 continue; 92 96 }
+1
t/lib-httpd.sh
··· 131 131 cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH" 132 132 install_script incomplete-length-upload-pack-v2-http.sh 133 133 install_script incomplete-body-upload-pack-v2-http.sh 134 + install_script error-no-report.sh 134 135 install_script broken-smart-http.sh 135 136 install_script error-smart-http.sh 136 137 install_script error.sh
+4
t/lib-httpd/apache.conf
··· 122 122 </LocationMatch> 123 123 ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/ 124 124 ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/ 125 + ScriptAlias /smart/no_report/git-receive-pack error-no-report.sh/ 125 126 ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/ 126 127 ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 127 128 ScriptAlias /broken_smart/ broken-smart-http.sh/ ··· 135 136 Options ExecCGI 136 137 </Files> 137 138 <Files incomplete-body-upload-pack-v2-http.sh> 139 + Options ExecCGI 140 + </Files> 141 + <Files error-no-report.sh> 138 142 Options ExecCGI 139 143 </Files> 140 144 <Files broken-smart-http.sh>
+6
t/lib-httpd/error-no-report.sh
··· 1 + echo "Content-Type: application/x-git-receive-pack-result" 2 + echo 3 + printf '0013\001000eunpack ok\n' 4 + printf '0015\002skipping report\n' 5 + printf '0009\0010000' 6 + printf '0000'
+16
t/t5541-http-push-smart.sh
··· 509 509 test_i18ngrep ! "^hint: " decoded 510 510 ' 511 511 512 + test_expect_success 'report error server does not provide ref status' ' 513 + git init "$HTTPD_DOCUMENT_ROOT_PATH/no_report" && 514 + git -C "$HTTPD_DOCUMENT_ROOT_PATH/no_report" config http.receivepack true && 515 + test_must_fail git push --porcelain \ 516 + $HTTPD_URL_USER_PASS/smart/no_report \ 517 + HEAD:refs/tags/will-fail >actual && 518 + test_must_fail git -C "$HTTPD_DOCUMENT_ROOT_PATH/no_report" \ 519 + rev-parse --verify refs/tags/will-fail && 520 + cat >expect <<-EOF && 521 + To $HTTPD_URL/smart/no_report 522 + ! HEAD:refs/tags/will-fail [remote failure] (remote failed to report status) 523 + Done 524 + EOF 525 + test_cmp expect actual 526 + ' 527 + 512 528 test_done
+4
transport-helper.c
··· 845 845 forced = 1; 846 846 FREE_AND_NULL(msg); 847 847 } 848 + else if (!strcmp(msg, "expecting report")) { 849 + status = REF_STATUS_EXPECTING_REPORT; 850 + FREE_AND_NULL(msg); 851 + } 848 852 } 849 853 850 854 if (state->hint)