diff options
Diffstat (limited to 'src/libgit2/transports/smart.h')
-rw-r--r-- | src/libgit2/transports/smart.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/libgit2/transports/smart.h b/src/libgit2/transports/smart.h index d71160d8e..34e27ea8e 100644 --- a/src/libgit2/transports/smart.h +++ b/src/libgit2/transports/smart.h @@ -14,6 +14,7 @@ #include "netops.h" #include "push.h" #include "str.h" +#include "oidarray.h" #include "git2/sys/transport.h" #define GIT_SIDE_BAND_DATA 1 @@ -32,6 +33,7 @@ #define GIT_CAP_SYMREF "symref" #define GIT_CAP_WANT_TIP_SHA1 "allow-tip-sha1-in-want" #define GIT_CAP_WANT_REACHABLE_SHA1 "allow-reachable-sha1-in-want" +#define GIT_CAP_SHALLOW "shallow" #define GIT_CAP_OBJECT_FORMAT "object-format=" #define GIT_CAP_AGENT "agent=" @@ -50,7 +52,9 @@ typedef enum { GIT_PKT_PROGRESS, GIT_PKT_OK, GIT_PKT_NG, - GIT_PKT_UNPACK + GIT_PKT_UNPACK, + GIT_PKT_SHALLOW, + GIT_PKT_UNSHALLOW } git_pkt_type; /* Used for multi_ack and multi_ack_detailed */ @@ -122,6 +126,11 @@ typedef struct { int unpack_ok; } git_pkt_unpack; +typedef struct { + git_pkt_type type; + git_oid oid; +} git_pkt_shallow; + typedef struct transport_smart_caps { unsigned int common:1, ofs_delta:1, @@ -134,7 +143,8 @@ typedef struct transport_smart_caps { report_status:1, thin_pack:1, want_tip_sha1:1, - want_reachable_sha1:1; + want_reachable_sha1:1, + shallow:1; char *object_format; char *agent; } transport_smart_caps; @@ -153,6 +163,7 @@ typedef struct { git_vector refs; git_vector heads; git_vector common; + git_array_oid_t shallow_roots; git_atomic32 cancelled; packetsize_cb packetsize_cb; void *packetsize_payload; @@ -171,8 +182,9 @@ int git_smart__push(git_transport *transport, git_push *push); int git_smart__negotiate_fetch( git_transport *transport, git_repository *repo, - const git_remote_head * const *refs, - size_t count); + const git_fetch_negotiation *wants); + +int git_smart__shallow_roots(git_oidarray *out, git_transport *transport); int git_smart__download_pack( git_transport *transport, @@ -195,7 +207,7 @@ int git_pkt_parse_line(git_pkt **head, const char **endptr, const char *line, si int git_pkt_buffer_flush(git_str *buf); int git_pkt_send_flush(GIT_SOCKET s); int git_pkt_buffer_done(git_str *buf); -int git_pkt_buffer_wants(const git_remote_head * const *refs, size_t count, transport_smart_caps *caps, git_str *buf); +int git_pkt_buffer_wants(const git_fetch_negotiation *wants, transport_smart_caps *caps, git_str *buf); int git_pkt_buffer_have(git_oid *oid, git_str *buf); void git_pkt_free(git_pkt *pkt); |