From 923c16527c30c7ad067ebb308b1572b3d163b54c Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 6 Feb 2022 09:36:51 -0500 Subject: transport: add capabilities query function --- include/git2/sys/transport.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h index 89e687649..f0c2a3eab 100644 --- a/include/git2/sys/transport.h +++ b/include/git2/sys/transport.h @@ -46,6 +46,16 @@ struct git_transport { git_transport *transport, const git_remote_connect_options *connect_opts); + /** + * Gets the capabilities for this remote repository. + * + * This function may be called after a successful call to + * `connect()`. + */ + int GIT_CALLBACK(capabilities)( + unsigned int *capabilities, + git_transport *transport); + /** * Get the list of available references in the remote repository. * -- cgit v1.2.1 From 37d98aaf4463db1ccb6a325409210aab799db115 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 6 Feb 2022 14:59:24 -0500 Subject: transport: transports can indicate support for fetch by oid --- include/git2/sys/remote.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/git2/sys/remote.h (limited to 'include') diff --git a/include/git2/sys/remote.h b/include/git2/sys/remote.h new file mode 100644 index 000000000..dd243ca55 --- /dev/null +++ b/include/git2/sys/remote.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#ifndef INCLUDE_sys_git_remote_h +#define INCLUDE_sys_git_remote_h + +/** + * @file git2/sys/remote.h + * @brief Low-level remote functionality for custom transports + * @defgroup git_remote Low-level remote functionality + * @ingroup Git + * @{ +*/ + +GIT_BEGIN_DECL + +typedef enum { + /** Remote supports fetching an advertised object by ID. */ + GIT_REMOTE_CAPABILITY_TIP_OID = (1 << 0), + + /** Remote supports fetching an individual reachable object. */ + GIT_REMOTE_CAPABILITY_REACHABLE_OID = (1 << 1), +} git_remote_capability_t; + +/** @} */ +GIT_END_DECL +#endif -- cgit v1.2.1