libgit2/pygit2 — pull request #347 by atheriel (2014-02-21 03:10:38+00:00)
Title: Implement all of the options for `init_repository` from libgit.

This patch should fully implement all of the options currently provided by [git_repository_init_options](http://libgit2.github.com/libgit2/#HEAD/type/git_repository_init_options) for initializing repositories.

Much of the C code is drawn from libgit's `init.c` example.

I have made one implementation change: setting the working tree will work like git-init(1) instead of the way it works in libgit, in that it uses an absolute path as opposed to a path relative to the repository. This means that

```python
import pygit2
pygit2.init_repository('.', working_dir = './myproject')
```

will result in the following directory structure

.
..
.git/
...
config (file with core.worktree = ../myproject/)
...
myproject/
.git (file with content )

as opposed to the default behaviour, which creates

.
..
.git/
...
config (file with core.worktree = ../myproject/)
...
myproject/
... files here ...

A full use of the options might look like the following at the moment:

```python
import pygit2
pygit2.init_repository(
'dog',
bare = False,
template_dir = '/usr/local/git/share/git-core/templates',
shared = 'umask',
initial_head = 'master2',
origin_url = 'http://github.com/atheriel/test',
working_dir = 'dog2'
)
```

Let me know if there's anything I else I can do.

Aaron Jacobs
atheriel@gmail.com