summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-05-08 10:07:11 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-05-09 17:14:08 +0100
commit0a7e32b2326c02a91f9560dfd209e56ea9fb9d49 (patch)
tree1040ae92dd88cdacce82395200ecf4f966883310 /include
parent04cddffea9d00d5788b4f41a7dce3356089228ab (diff)
downloadlibgit2-0a7e32b2326c02a91f9560dfd209e56ea9fb9d49.tar.gz
oid: use an oid array instead of shallowarray
Users should provide us an array of object ids; we don't need a separate type. And especially, we should not be mutating user-providing values. Instead, use `git_oid *` in the shallow code.
Diffstat (limited to 'include')
-rw-r--r--include/git2/sys/transport.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h
index 062bcd0ed..96a35d08c 100644
--- a/include/git2/sys/transport.h
+++ b/include/git2/sys/transport.h
@@ -25,12 +25,11 @@
GIT_BEGIN_DECL
-typedef struct git_shallowarray git_shallowarray;
-
typedef struct {
const git_remote_head * const *refs;
- size_t count;
- git_shallowarray *shallow_roots;
+ size_t refs_len;
+ git_oid *shallow_roots;
+ size_t shallow_roots_len;
int depth;
} git_fetch_negotiation;
@@ -108,6 +107,16 @@ struct git_transport {
const git_fetch_negotiation *fetch_data);
/**
+ * Return the shallow roots of the remote.
+ *
+ * This function may be called after a successful call to
+ * `negotiate_fetch`.
+ */
+ int GIT_CALLBACK(shallow_roots)(
+ git_oidarray *out,
+ git_transport *transport);
+
+ /**
* Start downloading the packfile from the remote repository.
*
* This function may be called after a successful call to
@@ -450,11 +459,6 @@ GIT_EXTERN(int) git_smart_subtransport_ssh(
git_transport *owner,
void *param);
-GIT_EXTERN(size_t) git_shallowarray_count(git_shallowarray *array);
-GIT_EXTERN(const git_oid *) git_shallowarray_get(git_shallowarray *array, size_t idx);
-GIT_EXTERN(int) git_shallowarray_add(git_shallowarray *array, git_oid *oid);
-GIT_EXTERN(int) git_shallowarray_remove(git_shallowarray *array, git_oid *oid);
-
/** @} */
GIT_END_DECL
#endif