Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve pack list response handling

Better response handling for pack list requests - a 404 means we do have
the list but it happens to be empty.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information...
commit 5e3a769186bc41f94c1970579f96f3b68b046ed6 1 parent e388ab7
Nick Hengeveld authored Junio C Hamano committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 http-fetch.c
12 http-fetch.c
View
@@ -637,10 +637,18 @@ static int fetch_indices(struct alt_base *repo)
if (start_active_slot(slot)) {
run_active_slot(slot);
if (slot->curl_result != CURLE_OK) {
- free(buffer.buffer);
- return error("%s", curl_errorstr);
+ if (slot->http_code == 404) {
+ repo->got_indices = 1;
+ free(buffer.buffer);
+ return 0;
+ } else {
+ repo->got_indices = 0;
+ free(buffer.buffer);
+ return error("%s", curl_errorstr);
+ }
}
} else {
+ repo->got_indices = 0;
free(buffer.buffer);
return error("Unable to start request");
}
Please sign in to comment.
Something went wrong with that request. Please try again.