Skip to content

Commit 58650be

Browse files
pks-tgitster
authored andcommitted
protocol-caps: use hash algorithm from passed-in repository
In `send_info()`, we pass in a repository but then use `get_oid_hex()` to parse passed-in object IDs, which implicitly uses `the_repository`. Fix this by using the hash algorithm from the passed-in repository instead. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2c32a6 commit 58650be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

protocol-caps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "hex.h"
88
#include "object.h"
99
#include "object-store-ll.h"
10+
#include "repository.h"
1011
#include "string-list.h"
1112
#include "strbuf.h"
1213

@@ -52,7 +53,7 @@ static void send_info(struct repository *r, struct packet_writer *writer,
5253
struct object_id oid;
5354
unsigned long object_size;
5455

55-
if (get_oid_hex(oid_str, &oid) < 0) {
56+
if (get_oid_hex_algop(oid_str, &oid, r->hash_algo) < 0) {
5657
packet_writer_error(
5758
writer,
5859
"object-info: protocol error, expected to get oid, not '%s'",

0 commit comments

Comments
 (0)