@@ -1413,6 +1413,7 @@ fn github_fast_path(
1413
1413
// the branch has moved.
1414
1414
if let Some ( local_object) = local_object {
1415
1415
if is_short_hash_of ( rev, local_object) {
1416
+ debug ! ( "github fast path already has {local_object}" ) ;
1416
1417
return Ok ( FastPathRev :: UpToDate ) ;
1417
1418
}
1418
1419
}
@@ -1452,6 +1453,7 @@ fn github_fast_path(
1452
1453
handle. get ( true ) ?;
1453
1454
handle. url ( & url) ?;
1454
1455
handle. useragent ( "cargo" ) ?;
1456
+ handle. follow_location ( true ) ?; // follow redirects
1455
1457
handle. http_headers ( {
1456
1458
let mut headers = List :: new ( ) ;
1457
1459
headers. append ( "Accept: application/vnd.github.3.sha" ) ?;
@@ -1472,14 +1474,17 @@ fn github_fast_path(
1472
1474
1473
1475
let response_code = handle. response_code ( ) ?;
1474
1476
if response_code == 304 {
1477
+ debug ! ( "github fast path up-to-date" ) ;
1475
1478
Ok ( FastPathRev :: UpToDate )
1476
1479
} else if response_code == 200 {
1477
1480
let oid_to_fetch = str:: from_utf8 ( & response_body) ?. parse :: < Oid > ( ) ?;
1481
+ debug ! ( "github fast path fetch {oid_to_fetch}" ) ;
1478
1482
Ok ( FastPathRev :: NeedsFetch ( oid_to_fetch) )
1479
1483
} else {
1480
1484
// Usually response_code == 404 if the repository does not exist, and
1481
1485
// response_code == 422 if exists but GitHub is unable to resolve the
1482
1486
// requested rev.
1487
+ debug ! ( "github fast path bad response code {response_code}" ) ;
1483
1488
Ok ( FastPathRev :: Indeterminate )
1484
1489
}
1485
1490
}
0 commit comments