Skip to content

Commit 7a06a54

Browse files
committed
Move to libgit2 master
1 parent 524210f commit 7a06a54

File tree

10 files changed

+28
-25
lines changed

10 files changed

+28
-25
lines changed

.travis.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ fi
99

1010
cd ~
1111

12-
git clone --depth=1 -b "maint/v${LIBGIT2_VERSION}" https://github.com/libgit2/libgit2.git
12+
#git clone --depth=1 -b "maint/v${LIBGIT2_VERSION}" https://github.com/libgit2/libgit2.git
13+
git clone --depth=1 -b master https://github.com/libgit2/libgit2.git
1314
cd libgit2/
1415

1516
mkdir build && cd build

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build_script:
3636
# Clone, build and install libgit2
3737
- cmd: |
3838
set LIBGIT2=%APPVEYOR_BUILD_FOLDER%\venv
39-
git clone --depth=1 -b maint/v0.28 https://github.com/libgit2/libgit2.git libgit2
39+
git clone --depth=1 -b master https://github.com/libgit2/libgit2.git libgit2
4040
cd libgit2
4141
cmake . -DBUILD_CLAR=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%LIBGIT2%" -G "%GENERATOR%"
4242
cmake --build . --target install

pygit2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def clone_repository(
229229
d_handle = ffi.new_handle(d)
230230

231231
# Perform the initialization with the version we compiled
232-
C.git_clone_init_options(opts, C.GIT_CLONE_OPTIONS_VERSION)
232+
C.git_clone_options_init(opts, C.GIT_CLONE_OPTIONS_VERSION)
233233

234234
# We need to keep the ref alive ourselves
235235
checkout_branch_ref = None

pygit2/_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'pack.h',
6565
'transport.h',
6666
'proxy.h',
67+
'indexer.h',
6768
'remote.h',
6869
'clone.h',
6970
'common.h',

pygit2/decl/clone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct git_clone_options {
3333
void *remote_cb_payload;
3434
} git_clone_options;
3535

36-
int git_clone_init_options(
36+
int git_clone_options_init(
3737
git_clone_options *opts,
3838
unsigned int version);
3939

pygit2/decl/indexer.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
typedef struct git_indexer_progress {
2+
unsigned int total_objects;
3+
unsigned int indexed_objects;
4+
unsigned int received_objects;
5+
unsigned int local_objects;
6+
unsigned int total_deltas;
7+
unsigned int indexed_deltas;
8+
size_t received_bytes;
9+
} git_indexer_progress;
10+
11+
typedef int (*git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload);

pygit2/decl/remote.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#define GIT_PUSH_OPTIONS_VERSION ...
33
#define GIT_REMOTE_CALLBACKS_VERSION ...
44

5-
typedef enum git_remote_completion_type {
5+
typedef enum git_remote_completion_t {
66
GIT_REMOTE_COMPLETION_DOWNLOAD,
77
GIT_REMOTE_COMPLETION_INDEXING,
88
GIT_REMOTE_COMPLETION_ERROR,
9-
} git_remote_completion_type;
9+
} git_remote_completion_t;
1010

11-
typedef int (*git_push_transfer_progress)(
11+
typedef int (*git_push_transfer_progress_cb)(
1212
unsigned int current,
1313
unsigned int total,
1414
size_t bytes,
@@ -23,21 +23,23 @@ typedef struct {
2323

2424
typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload);
2525
typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data);
26+
typedef int (*git_url_resolve_cb)(git_buf *url_resolved, const char *url, int direction, void *payload);
2627

2728
struct git_remote_callbacks {
2829
unsigned int version;
2930
git_transport_message_cb sideband_progress;
30-
int (*completion)(git_remote_completion_type type, void *data);
31+
int (*completion)(git_remote_completion_t type, void *data);
3132
git_cred_acquire_cb credentials;
3233
git_transport_certificate_check_cb certificate_check;
33-
git_transfer_progress_cb transfer_progress;
34+
git_indexer_progress_cb transfer_progress;
3435
int (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data);
3536
git_packbuilder_progress pack_progress;
36-
git_push_transfer_progress push_transfer_progress;
37+
git_push_transfer_progress_cb push_transfer_progress;
3738
git_push_update_reference_cb push_update_reference;
3839
git_push_negotiation push_negotiation;
3940
git_transport_cb transport;
4041
void *payload;
42+
git_url_resolve_cb resolve_url;
4143
};
4244

4345
typedef struct {
@@ -112,7 +114,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks);
112114
int git_remote_push(git_remote *remote,
113115
const git_strarray *refspecs,
114116
const git_push_options *opts);
115-
const git_transfer_progress * git_remote_stats(git_remote *remote);
117+
const git_indexer_progress * git_remote_stats(git_remote *remote);
116118
int git_remote_add_push(git_repository *repo, const char *remote, const char *refspec);
117119
int git_remote_add_fetch(git_repository *repo, const char *remote, const char *refspec);
118120
int git_remote_init_callbacks(

pygit2/decl/types.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ typedef struct git_signature {
3333
git_time when;
3434
} git_signature;
3535

36-
typedef struct git_transfer_progress {
37-
unsigned int total_objects;
38-
unsigned int indexed_objects;
39-
unsigned int received_objects;
40-
unsigned int local_objects;
41-
unsigned int total_deltas;
42-
unsigned int indexed_deltas;
43-
size_t received_bytes;
44-
} git_transfer_progress;
45-
46-
4736
typedef enum git_cert_t {
4837
GIT_CERT_NONE,
4938
GIT_CERT_X509,
@@ -56,7 +45,6 @@ typedef struct {
5645
} git_cert;
5746

5847
typedef int (*git_transport_message_cb)(const char *str, int len, void *payload);
59-
typedef int (*git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload);
6048
typedef int (*git_transport_certificate_check_cb)(git_cert *cert, int valid, const char *host, void *payload);
6149

6250
typedef enum {

pygit2/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _fill_connect_callbacks(self, connect_callbacks):
220220
# These functions exist to be called by the git_remote as
221221
# callbacks. They proxy the call to whatever the user set
222222

223-
@ffi.callback('git_transfer_progress_cb')
223+
@ffi.callback('git_indexer_progress_cb')
224224
def _transfer_progress_cb(stats_ptr, data):
225225
self = ffi.from_handle(data)
226226

src/worktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Worktree_prune(Worktree *self, PyObject *args)
7171
if (!PyArg_ParseTuple(args, "|i", &force))
7272
return NULL;
7373

74-
git_worktree_prune_init_options(&prune_opts, GIT_WORKTREE_PRUNE_OPTIONS_VERSION);
74+
git_worktree_prune_options_init(&prune_opts, GIT_WORKTREE_PRUNE_OPTIONS_VERSION);
7575
prune_opts.flags = force & (GIT_WORKTREE_PRUNE_VALID | GIT_WORKTREE_PRUNE_LOCKED);
7676

7777
err = git_worktree_prune(self->worktree, &prune_opts);

0 commit comments

Comments
 (0)