path: root/http.c
diff options
authorShawn O. Pearce <>2010-04-19 14:23:08 (GMT)
committerJunio C Hamano <>2010-04-20 00:56:17 (GMT)
commit7b64469a363c10e9e875a73d32a220ba48694a28 (patch)
tree66c7dccc1f4366b74c592ce27fa45cb1e51be702 /http.c
parent9b0aa728705439ca4b4e7ec845f79f8487059320 (diff)
Allow parse_pack_index on temporary files
The easiest way to verify a pack index is to open it through the standard parse_pack_index function, permitting the header check to happen when the file is mapped. However, the dumb HTTP client needs to verify a pack index before its moved into its proper file name within the objects/pack directory, to prevent a corrupt index from being made available. So permit the caller to specify the exact path of the index file. For now we're still using the final destination name within the sole call site in http.c, but eventually we will start to parse the temporary path instead. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'http.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/http.c b/http.c
index 95e3b8b..9c62632 100644
--- a/http.c
+++ b/http.c
@@ -932,7 +932,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head,
if (fetch_pack_index(sha1, base_url))
return -1;
- new_pack = parse_pack_index(sha1);
+ new_pack = parse_pack_index(sha1, sha1_pack_index_name(sha1));
if (!new_pack)
return -1; /* parse_pack_index() already issued error message */
new_pack->next = *packs_head;