summaryrefslogtreecommitdiff
path: root/http-walker.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-25 07:41:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-25 07:41:17 (GMT)
commitd4e568b2a31d7b2fe45dac9165bb077b570fc96a (patch)
treebff4affbf3e8c472cb914238eef19820d1ac4872 /http-walker.c
parentdae82ecf147c58c6862d349fb8421d81f5868616 (diff)
parentcfb049119c9e8b8f66a2e1faf1621ac48f714412 (diff)
downloadgit-d4e568b2a31d7b2fe45dac9165bb077b570fc96a.zip
git-d4e568b2a31d7b2fe45dac9165bb077b570fc96a.tar.gz
git-d4e568b2a31d7b2fe45dac9165bb077b570fc96a.tar.bz2
Merge branch 'bc/hash-transition-16'
Conversion from unsigned char[20] to struct object_id continues. * bc/hash-transition-16: (35 commits) gitweb: make hash size independent Git.pm: make hash size independent read-cache: read data in a hash-independent way dir: make untracked cache extension hash size independent builtin/difftool: use parse_oid_hex refspec: make hash size independent archive: convert struct archiver_args to object_id builtin/get-tar-commit-id: make hash size independent get-tar-commit-id: parse comment record hash: add a function to lookup hash algorithm by length remote-curl: make hash size independent http: replace sha1_to_hex http: compute hash of downloaded objects using the_hash_algo http: replace hard-coded constant with the_hash_algo http-walker: replace sha1_to_hex http-push: remove remaining uses of sha1_to_hex http-backend: allow 64-character hex names http-push: convert to use the_hash_algo builtin/pull: make hash-size independent builtin/am: make hash size independent ...
Diffstat (limited to 'http-walker.c')
-rw-r--r--http-walker.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/http-walker.c b/http-walker.c
index 48b1b3a..fe15e32 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -442,9 +442,9 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
if (walker->get_verbosely) {
fprintf(stderr, "Getting pack %s\n",
- sha1_to_hex(target->sha1));
+ hash_to_hex(target->hash));
fprintf(stderr, " which contains %s\n",
- sha1_to_hex(sha1));
+ hash_to_hex(sha1));
}
preq = new_http_pack_request(target, repo->base);
@@ -481,9 +481,9 @@ static void abort_object_request(struct object_request *obj_req)
release_object_request(obj_req);
}
-static int fetch_object(struct walker *walker, unsigned char *sha1)
+static int fetch_object(struct walker *walker, unsigned char *hash)
{
- char *hex = sha1_to_hex(sha1);
+ char *hex = hash_to_hex(hash);
int ret = 0;
struct object_request *obj_req = NULL;
struct http_object_request *req;
@@ -491,7 +491,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
list_for_each(pos, head) {
obj_req = list_entry(pos, struct object_request, node);
- if (hasheq(obj_req->oid.hash, sha1))
+ if (hasheq(obj_req->oid.hash, hash))
break;
}
if (obj_req == NULL)
@@ -556,20 +556,20 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
return ret;
}
-static int fetch(struct walker *walker, unsigned char *sha1)
+static int fetch(struct walker *walker, unsigned char *hash)
{
struct walker_data *data = walker->data;
struct alt_base *altbase = data->alt;
- if (!fetch_object(walker, sha1))
+ if (!fetch_object(walker, hash))
return 0;
while (altbase) {
- if (!http_fetch_pack(walker, altbase, sha1))
+ if (!http_fetch_pack(walker, altbase, hash))
return 0;
fetch_alternates(walker, data->alt->base);
altbase = altbase->next;
}
- return error("Unable to find %s under %s", sha1_to_hex(sha1),
+ return error("Unable to find %s under %s", hash_to_hex(hash),
data->alt->base);
}