Skip to content

Commit 1cb158b

Browse files
bk2204gitster
authored andcommitted
http-push: remove remaining uses of sha1_to_hex
Since sha1_to_hex is limited to SHA-1, switch all remaining uses of it in this file to hash_to_hex or oid_to_hex. Modify update_remote to take a pointer to struct object_id, and since we don't modify that parameter in the function, set it to be const as well. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f786ae9 commit 1cb158b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

http-push.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static void start_fetch_packed(struct transfer_request *request)
316316
}
317317

318318
fprintf(stderr, "Fetching pack %s\n",
319-
sha1_to_hex(target->hash));
319+
hash_to_hex(target->hash));
320320
fprintf(stderr, " which contains %s\n", oid_to_hex(&request->obj->oid));
321321

322322
preq = new_http_pack_request(target, repo->url);
@@ -1374,7 +1374,7 @@ static int get_delta(struct rev_info *revs, struct remote_lock *lock)
13741374
return count;
13751375
}
13761376

1377-
static int update_remote(unsigned char *sha1, struct remote_lock *lock)
1377+
static int update_remote(const struct object_id *oid, struct remote_lock *lock)
13781378
{
13791379
struct active_request_slot *slot;
13801380
struct slot_results results;
@@ -1383,7 +1383,7 @@ static int update_remote(unsigned char *sha1, struct remote_lock *lock)
13831383

13841384
dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF);
13851385

1386-
strbuf_addf(&out_buffer.buf, "%s\n", sha1_to_hex(sha1));
1386+
strbuf_addf(&out_buffer.buf, "%s\n", oid_to_hex(oid));
13871387

13881388
slot = get_active_slot();
13891389
slot->results = &results;
@@ -1948,7 +1948,7 @@ int cmd_main(int argc, const char **argv)
19481948
run_request_queue();
19491949

19501950
/* Update the remote branch if all went well */
1951-
if (aborted || !update_remote(ref->new_oid.hash, ref_lock))
1951+
if (aborted || !update_remote(&ref->new_oid, ref_lock))
19521952
rc = 1;
19531953

19541954
if (!rc)

0 commit comments

Comments
 (0)