@@ -1413,6 +1413,7 @@ fn github_fast_path(
14131413 // the branch has moved.
14141414 if let Some ( local_object) = local_object {
14151415 if is_short_hash_of ( rev, local_object) {
1416+ debug ! ( "github fast path already has {local_object}" ) ;
14161417 return Ok ( FastPathRev :: UpToDate ) ;
14171418 }
14181419 }
@@ -1452,6 +1453,7 @@ fn github_fast_path(
14521453 handle. get ( true ) ?;
14531454 handle. url ( & url) ?;
14541455 handle. useragent ( "cargo" ) ?;
1456+ handle. follow_location ( true ) ?; // follow redirects
14551457 handle. http_headers ( {
14561458 let mut headers = List :: new ( ) ;
14571459 headers. append ( "Accept: application/vnd.github.3.sha" ) ?;
@@ -1472,14 +1474,17 @@ fn github_fast_path(
14721474
14731475 let response_code = handle. response_code ( ) ?;
14741476 if response_code == 304 {
1477+ debug ! ( "github fast path up-to-date" ) ;
14751478 Ok ( FastPathRev :: UpToDate )
14761479 } else if response_code == 200 {
14771480 let oid_to_fetch = str:: from_utf8 ( & response_body) ?. parse :: < Oid > ( ) ?;
1481+ debug ! ( "github fast path fetch {oid_to_fetch}" ) ;
14781482 Ok ( FastPathRev :: NeedsFetch ( oid_to_fetch) )
14791483 } else {
14801484 // Usually response_code == 404 if the repository does not exist, and
14811485 // response_code == 422 if exists but GitHub is unable to resolve the
14821486 // requested rev.
1487+ debug ! ( "github fast path bad response code {response_code}" ) ;
14831488 Ok ( FastPathRev :: Indeterminate )
14841489 }
14851490}
0 commit comments