Skip to content

Commit c1d831c

Browse files
committed
Update to libgit2 v0.24
1 parent 391a3a7 commit c1d831c

File tree

4 files changed

+52
-26
lines changed

4 files changed

+52
-26
lines changed

.travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
cd ~
44

5-
git clone --depth=1 -b maint/v0.23 https://github.com/libgit2/libgit2.git
5+
git clone --depth=1 -b maint/v0.24 https://github.com/libgit2/libgit2.git
66
cd libgit2/
77

88
mkdir build && cd build

pygit2/decl.h

+48-22
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ typedef enum {
5454
GIT_EINVALIDSPEC = -12,
5555
GIT_ECONFLICT = -13,
5656
GIT_ELOCKED = -14,
57+
GIT_EMODIFIED = -15,
58+
GIT_EAUTH = -16,
59+
GIT_ECERTIFICATE = -17,
60+
GIT_EAPPLIED = -18,
61+
GIT_EPEEL = -19,
62+
GIT_EEOF = -20,
63+
GIT_EINVALID = -21,
64+
GIT_EUNCOMMITTED = -22,
65+
GIT_EDIRECTORY = -23,
66+
GIT_EMERGECONFLICT = -24,
5767

5868
GIT_PASSTHROUGH = -30,
5969
GIT_ITEROVER = -31,
@@ -131,21 +141,21 @@ typedef enum {
131141

132142
typedef struct {
133143
git_cert_t cert_type;
144+
} git_cert;
145+
146+
typedef struct {
147+
git_cert parent;
134148
git_cert_ssh_t type;
135149
unsigned char hash_md5[16];
136150
unsigned char hash_sha1[20];
137151
} git_cert_hostkey;
138152

139153
typedef struct {
140-
git_cert_t cert_type;
154+
git_cert parent;
141155
void *data;
142156
size_t len;
143157
} git_cert_x509;
144158

145-
typedef struct {
146-
git_cert_t cert_type;
147-
} git_cert;
148-
149159
typedef int (*git_transport_message_cb)(const char *str, int len, void *data);
150160
typedef int (*git_cred_acquire_cb)(
151161
git_cred **cred,
@@ -201,6 +211,7 @@ typedef struct {
201211
unsigned int version;
202212
unsigned int pb_parallelism;
203213
git_remote_callbacks callbacks;
214+
git_strarray custom_headers;
204215
} git_push_options;
205216

206217
#define GIT_PUSH_OPTIONS_VERSION ...
@@ -225,6 +236,7 @@ typedef struct {
225236
git_fetch_prune_t prune;
226237
int update_fetchhead;
227238
git_remote_autotag_option_t download_tags;
239+
git_strarray custom_headers;
228240
} git_fetch_options;
229241

230242
#define GIT_FETCH_OPTIONS_VERSION ...
@@ -336,13 +348,20 @@ typedef int (*git_diff_notify_cb)(
336348
const char *matched_pathspec,
337349
void *payload);
338350

351+
typedef int (*git_diff_progress_cb)(
352+
const git_diff *diff_so_far,
353+
const char *old_path,
354+
const char *new_path,
355+
void *payload);
356+
339357
typedef struct {
340358
unsigned int version;
341359
uint32_t flags;
342360
git_submodule_ignore_t ignore_submodules;
343361
git_strarray pathspec;
344-
git_diff_notify_cb notify_cb;
345-
void *notify_payload;
362+
git_diff_notify_cb notify_cb;
363+
git_diff_progress_cb progress_cb;
364+
void *payload;
346365
uint32_t context_lines;
347366
uint32_t interhunk_lines;
348367
uint16_t id_abbrev;
@@ -478,11 +497,12 @@ typedef ... git_config;
478497
typedef ... git_config_iterator;
479498

480499
typedef enum {
481-
GIT_CONFIG_LEVEL_SYSTEM = 1,
482-
GIT_CONFIG_LEVEL_XDG = 2,
483-
GIT_CONFIG_LEVEL_GLOBAL = 3,
484-
GIT_CONFIG_LEVEL_LOCAL = 4,
485-
GIT_CONFIG_LEVEL_APP = 5,
500+
GIT_CONFIG_LEVEL_PROGRAMDATA = 1,
501+
GIT_CONFIG_LEVEL_SYSTEM = 2,
502+
GIT_CONFIG_LEVEL_XDG = 3,
503+
GIT_CONFIG_LEVEL_GLOBAL = 4,
504+
GIT_CONFIG_LEVEL_LOCAL = 5,
505+
GIT_CONFIG_LEVEL_APP = 6,
486506
GIT_CONFIG_HIGHEST_LEVEL = -1,
487507
} git_config_level_t;
488508

@@ -671,22 +691,22 @@ typedef struct git_blame_options {
671691
uint16_t min_match_characters;
672692
git_oid newest_commit;
673693
git_oid oldest_commit;
674-
uint32_t min_line;
675-
uint32_t max_line;
694+
size_t min_line;
695+
size_t max_line;
676696
} git_blame_options;
677697

678698
#define GIT_BLAME_OPTIONS_VERSION ...
679699

680700
typedef struct git_blame_hunk {
681-
uint16_t lines_in_hunk;
701+
size_t lines_in_hunk;
682702

683703
git_oid final_commit_id;
684-
uint16_t final_start_line_number;
704+
size_t final_start_line_number;
685705
git_signature *final_signature;
686706

687707
git_oid orig_commit_id;
688708
const char *orig_path;
689-
uint16_t orig_start_line_number;
709+
size_t orig_start_line_number;
690710
git_signature *orig_signature;
691711

692712
char boundary;
@@ -695,15 +715,15 @@ typedef struct git_blame_hunk {
695715
int git_blame_init_options(git_blame_options *opts, unsigned int version);
696716
uint32_t git_blame_get_hunk_count(git_blame *blame);
697717
const git_blame_hunk *git_blame_get_hunk_byindex(git_blame *blame, uint32_t index);
698-
const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, uint32_t lineno);
718+
const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, size_t lineno);
699719
int git_blame_file(git_blame **out, git_repository *repo, const char *path, git_blame_options *options);
700720
void git_blame_free(git_blame *blame);
701721

702722
/*
703723
* Merging
704724
*/
705725

706-
typedef enum { ... } git_merge_tree_flag_t;
726+
typedef enum { ... } git_merge_flag_t;
707727

708728
typedef enum {
709729
GIT_MERGE_FILE_FAVOR_NORMAL = 0,
@@ -714,10 +734,11 @@ typedef enum {
714734

715735
typedef struct {
716736
unsigned int version;
717-
git_merge_tree_flag_t tree_flags;
737+
git_merge_flag_t flags;
718738
unsigned int rename_threshold;
719739
unsigned int target_limit;
720740
git_diff_similarity_metric *metric;
741+
unsigned int recursion_limit;
721742
git_merge_file_favor_t file_favor;
722743
unsigned int file_flags;
723744
} git_merge_options;
@@ -737,15 +758,20 @@ typedef enum {
737758
GIT_MERGE_FILE_STYLE_MERGE = 1,
738759
GIT_MERGE_FILE_STYLE_DIFF3 = 2,
739760
GIT_MERGE_FILE_SIMPLIFY_ALNUM = 4,
740-
} git_merge_file_flags_t;
761+
GIT_MERGE_FILE_IGNORE_WHITESPACE = 8,
762+
GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = 16,
763+
GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = 32,
764+
GIT_MERGE_FILE_DIFF_PATIENCE = 64,
765+
GIT_MERGE_FILE_DIFF_MINIMAL = 128,
766+
} git_merge_file_flag_t;
741767

742768
typedef struct {
743769
unsigned int version;
744770
const char *ancestor_label;
745771
const char *our_label;
746772
const char *their_label;
747773
git_merge_file_favor_t favor;
748-
git_merge_file_flags_t flags;
774+
git_merge_file_flag_t flags;
749775
} git_merge_file_options;
750776

751777
#define GIT_MERGE_OPTIONS_VERSION ...

src/types.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include <Python.h>
3333
#include <git2.h>
3434

35-
#if !(LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR == 23)
36-
#error You need a compatible libgit2 version (v0.23.x)
35+
#if !(LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR == 24)
36+
#error You need a compatible libgit2 version (v0.24.x)
3737
#endif
3838

3939
/*

test/test_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_write(self):
153153
new_file.write("[this]\n\tthat = foobar\n\tthat = foobeer\n")
154154
new_file.close()
155155

156-
config.add_file(CONFIG_FILENAME, 5)
156+
config.add_file(CONFIG_FILENAME, 6)
157157
self.assertTrue('this.that' in config)
158158
l = config.get_multivar('this.that', 'foo.*')
159159
self.assertEqual(2, len(list(l)))

0 commit comments

Comments
 (0)