From 538b1523246ba0845564a6b703c6e4ff1921c16a Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 19 Feb 2019 00:05:03 +0000 Subject: object-store: rename and expand packed_git's sha1 member This member is used to represent the pack checksum of the pack in question. Expand this member to be GIT_MAX_RAWSZ bytes in length so it works with longer hashes and rename it to be "hash" instead of "sha1". This transformation was made with a change to the definition and the following semantic patch: @@ struct packed_git *E1; @@ - E1->sha1 + E1->hash @@ struct packed_git E1; @@ - E1.sha1 + E1.hash Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- http-walker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'http-walker.c') diff --git a/http-walker.c b/http-walker.c index 8ae5d76c6a..8063896cf6 100644 --- a/http-walker.c +++ b/http-walker.c @@ -434,7 +434,7 @@ 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)); + sha1_to_hex(target->hash)); fprintf(stderr, " which contains %s\n", sha1_to_hex(sha1)); } -- cgit v1.2.3 From 2bf1db786273e22070227a09d346c49026659f1e Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 19 Feb 2019 00:05:12 +0000 Subject: http-walker: replace sha1_to_hex Since sha1_to_hex is limited to SHA-1, replace the uses of it in this file with hash_to_hex. Rename several variables accordingly to reflect that they are no longer limited to SHA-1. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- http-walker.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'http-walker.c') diff --git a/http-walker.c b/http-walker.c index 8063896cf6..e11670eee2 100644 --- a/http-walker.c +++ b/http-walker.c @@ -434,9 +434,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->hash)); + 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); @@ -473,9 +473,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; @@ -483,7 +483,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) @@ -557,20 +557,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); } -- cgit v1.2.3