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

dumb-http walker has been updated to share more error recovery
strategy with the normal codepath.

* jk/http-walker-status-fix:
  http: use normalize_curl_result() instead of manual conversion
  http: normalize curl results for dumb loose and alternates fetches
  http: factor out curl result code normalization
This commit is contained in:
Junio C Hamano
2019-04-16 19:28:11 +09:00
4 changed files with 47 additions and 17 deletions

View File

@ -408,5 +408,21 @@ test_expect_success 'print HTTP error when any intermediate redirect throws erro
test_i18ngrep "unable to access.*/redir-to/502" stderr
'
test_expect_success 'fetching via http alternates works' '
parent=$HTTPD_DOCUMENT_ROOT_PATH/alt-parent.git &&
git init --bare "$parent" &&
git -C "$parent" --work-tree=. commit --allow-empty -m foo &&
git -C "$parent" update-server-info &&
commit=$(git -C "$parent" rev-parse HEAD) &&
child=$HTTPD_DOCUMENT_ROOT_PATH/alt-child.git &&
git init --bare "$child" &&
echo "../../alt-parent.git/objects" >"$child/objects/info/alternates" &&
git -C "$child" update-ref HEAD $commit &&
git -C "$child" update-server-info &&
git -c http.followredirects=true clone "$HTTPD_URL/dumb/alt-child.git"
'
stop_httpd
test_done