libgit2/pygit2

Support for GIT_REPOSITORY_INIT_SHARED_* ?

bochecha opened this issue · 2 comments

I'm trying to figure out how to create a new Git repository, and having it shared by the owning group.

Libgit2 allows this with the GIT_REPOSITORY_INIT_SHARED_GROUP member from the git_repository_init_mode_t enum, passing it to the git_repository_init_ext() function.

However, I can't figure out how to do that with pygit2. Is this simply not exposed yet?

Apologies if I merely missed it, but I couldn't find it in the documentation or in the pygit2 source code. 😃

Reading the libgit2 source code, I figured I could simply use the actual value directly:

        repo = pygit2.init_repository(repo_path, bare=True,
                                      description=description,
                                      mode=0o0002775)

So there's a workaround at least, but using something like mode=pygit2.repository.InitSharedGroup (or any other naming) would be much nicer.

You could use pygit2.C.GIT_REPOSITORY_INIT_SHARED_GROUP and now with latest commit just
pgyti2.GIT_REPOSITORY_INIT_SHARED_GROUP