diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-11 07:14:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 07:14:54 -0500 |
commit | 1d811f0eb990ecbba406f9a7debf463669218e9d (patch) | |
tree | e789c9622013fab289c0fb6935352e6aa707794c /include | |
parent | d299a7aad66e8e32135d801f47d46fecf9042b9f (diff) | |
parent | 9d88300a8ee9f184dd0299d0c1ba8487a6c2fb1a (diff) | |
download | libgit2-1d811f0eb990ecbba406f9a7debf463669218e9d.tar.gz |
Merge pull request #6203 from libgit2/ethomson/fetch_by_oid
Fetch by object id
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/sys/remote.h | 31 | ||||
-rw-r--r-- | include/git2/sys/transport.h | 10 |
2 files changed, 41 insertions, 0 deletions
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 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 @@ -47,6 +47,16 @@ struct git_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. * * This function may be called after a successful call to |