@matheusbsbs / matheus-bagliano / commits / 9a9f0d3fc0
Fork 0

pkt-line: add a member for hash algorithm

Add a member for the hash algorithm currently in use to the packet reader so it can parse references correctly. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed May 25, 2020 at 19:58 UTC 9a9f0d3fc0888599723812be62fa2d7b3cc4d2d6
2 files changed +4
pkt-line.c
+1
@@ -479,6 +479,7 @@ void packet_reader_init(struct packet_reader *reader, int fd,
479 reader->buffer_size = sizeof(packet_buffer);
480 reader->options = options;
481 reader->me = "git";
482 + reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
483 }
484
485 enum packet_read_status packet_reader_read(struct packet_reader *reader)
pkt-line.h
+3
@@ -166,6 +166,9 @@ struct packet_reader {
166
167 unsigned use_sideband : 1;
168 const char *me;
169 +
170 + /* hash algorithm in use */
171 + const struct git_hash_algo *hash_algo;
172 };
173
174 /*