Skip to content

Commit 7d34d2b

Browse files
committed
Use the initializer for repository init options
1 parent 63377aa commit 7d34d2b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pygit2/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def init_repository(path, bare=False,
8282

8383
# Options
8484
options = ffi.new('git_repository_init_options *')
85-
options.version = 1
85+
C.git_repository_init_init_options(options, C.GIT_REPOSITORY_INIT_OPTIONS_VERSION)
8686
options.flags = flags
8787
options.mode = mode
8888
options.workdir_path = to_bytes(workdir_path)

pygit2/decl.h

+3
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ typedef struct {
462462
const char *origin_url;
463463
} git_repository_init_options;
464464

465+
#define GIT_REPOSITORY_INIT_OPTIONS_VERSION ...
466+
int git_repository_init_init_options(git_repository_init_options *opts, int version);
467+
465468
int git_repository_init(
466469
git_repository **out,
467470
const char *path,

0 commit comments

Comments
 (0)