]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pkt-line: add a member for hash algorithm
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 25 May 2020 19:58:54 +0000 (19:58 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2020 17:07:06 +0000 (10:07 -0700)
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>
pkt-line.c
pkt-line.h

index a0e87b1e81408e17b4bb8e99bc162b6e7bce4012..a4aea075decca28e8aabd299b574dd70f860d36d 100644 (file)
@@ -479,6 +479,7 @@ void packet_reader_init(struct packet_reader *reader, int fd,
        reader->buffer_size = sizeof(packet_buffer);
        reader->options = options;
        reader->me = "git";
+       reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
 }
 
 enum packet_read_status packet_reader_read(struct packet_reader *reader)
index fef3a0d792d31bd04aa0145908db9dfb0c87c94d..4cd9435e9ad8414c360b39b77f25ad185e6dfa7f 100644 (file)
@@ -166,6 +166,9 @@ struct packet_reader {
 
        unsigned use_sideband : 1;
        const char *me;
+
+       /* hash algorithm in use */
+       const struct git_hash_algo *hash_algo;
 };
 
 /*