]> git.ipfire.org Git - thirdparty/git.git/blobdiff - transport.c
transport: add a hash algorithm member
[thirdparty/git.git] / transport.c
index 15f5ba4e8f22c69959357bc8a7fe073678fe8862..b43d985f90f9267688d064ba2fb5fcf0a2c366d2 100644 (file)
@@ -311,6 +311,7 @@ static struct ref *handshake(struct transport *transport, int for_push,
                BUG("unknown protocol version");
        }
        data->got_remote_heads = 1;
+       transport->hash_algo = reader.hash_algo;
 
        if (reader.line_peeked)
                BUG("buffer must be empty at the end of handshake()");
@@ -996,9 +997,16 @@ struct transport *transport_get(struct remote *remote, const char *url)
                        ret->smart_options->receivepack = remote->receivepack;
        }
 
+       ret->hash_algo = &hash_algos[GIT_HASH_SHA1];
+
        return ret;
 }
 
+const struct git_hash_algo *transport_get_hash_algo(struct transport *transport)
+{
+       return transport->hash_algo;
+}
+
 int transport_set_option(struct transport *transport,
                         const char *name, const char *value)
 {