git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] Improve pack list response handling

From
NHNick Hengeveld <nickh@reactrix.com>
Date
Nov 18, 2005, 19:03 UTC
Message-ID
<20051118190311.GH3968@reactrix.com>

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>
---
 http-fetch.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

applies-to: 8e27b8361908dda4ea5955f5ffe332b8cf09c0ec 20223d677b9d7291080acae9f9943aee90ee12ca

diff --git a/http-fetch.c b/http-fetch.c
index 53a7dbf..4353173 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -637,10 +637,18 @@ static int fetch_indices(struct alt_base
 	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");
 	}
---
0.99.9.GIT
Message 1 of 1 in “Improve pack list response handling”
  1. 3/5 Improve pack list response handlingNick Hengeveld, Nov 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.