From 7d34d2bb2722b8244657b9ffd20d86020fa070c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 13 Sep 2014 18:55:04 +0200 Subject: [PATCH] Use the initializer for repository init options --- pygit2/__init__.py | 2 +- pygit2/decl.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pygit2/__init__.py b/pygit2/__init__.py index 6df8478..48b15c7 100644 --- a/pygit2/__init__.py +++ b/pygit2/__init__.py @@ -82,7 +82,7 @@ def init_repository(path, bare=False, # Options options = ffi.new('git_repository_init_options *') - options.version = 1 + C.git_repository_init_init_options(options, C.GIT_REPOSITORY_INIT_OPTIONS_VERSION) options.flags = flags options.mode = mode options.workdir_path = to_bytes(workdir_path) diff --git a/pygit2/decl.h b/pygit2/decl.h index b8cd9c6..c64e10f 100644 --- a/pygit2/decl.h +++ b/pygit2/decl.h @@ -462,6 +462,9 @@ typedef struct { const char *origin_url; } git_repository_init_options; +#define GIT_REPOSITORY_INIT_OPTIONS_VERSION ... +int git_repository_init_init_options(git_repository_init_options *opts, int version); + int git_repository_init( git_repository **out, const char *path,