summaryrefslogtreecommitdiff
path: root/transport.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-05-25 19:58:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-27 17:07:06 (GMT)
commit7c97af4d64100bf9ce4b335ee91e743378e2e181 (patch)
treee25661f07b806ecf36ee46eed99b69019a50c334 /transport.h
parent9a9f0d3fc0888599723812be62fa2d7b3cc4d2d6 (diff)
downloadgit-7c97af4d64100bf9ce4b335ee91e743378e2e181.zip
git-7c97af4d64100bf9ce4b335ee91e743378e2e181.tar.gz
git-7c97af4d64100bf9ce4b335ee91e743378e2e181.tar.bz2
transport: add a hash algorithm member
When connecting to a remote system, we need to know what hash algorithm it will be using to talk to us. Add a hash_algo member to struct transport and add a function to read this data from the transport object. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.h')
-rw-r--r--transport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/transport.h b/transport.h
index 4298c85..2a9f96c 100644
--- a/transport.h
+++ b/transport.h
@@ -115,6 +115,8 @@ struct transport {
struct git_transport_options *smart_options;
enum transport_family family;
+
+ const struct git_hash_algo *hash_algo;
};
#define TRANSPORT_PUSH_ALL (1<<0)
@@ -243,6 +245,12 @@ int transport_push(struct repository *repo,
const struct ref *transport_get_remote_refs(struct transport *transport,
const struct argv_array *ref_prefixes);
+/*
+ * Fetch the hash algorithm used by a remote.
+ *
+ * This can only be called after fetching the remote refs.
+ */
+const struct git_hash_algo *transport_get_hash_algo(struct transport *transport);
int transport_fetch_refs(struct transport *transport, struct ref *refs);
void transport_unlock_pack(struct transport *transport);
int transport_disconnect(struct transport *transport);