diff options
| author | Vicent Martà <[email protected]> | 2013-03-06 07:48:16 -0800 |
|---|---|---|
| committer | Vicent Martà <[email protected]> | 2013-03-06 07:48:16 -0800 |
| commit | bdfd8736bc8c119c4a841fd8b1c8202f5d5ceb9a (patch) | |
| tree | 287985309c887abb33b921239247e70420d40145 /repository.go | |
| parent | 9b6d570748ae51bf38e3192f9a5de45bc68b23c6 (diff) | |
| parent | 23ba0f1e6dbfa75c71958f016b3e212d65143b60 (diff) | |
Merge pull request #4 from carlosmn/index
Wrap the index and test it a bit
Diffstat (limited to 'repository.go')
| -rw-r--r-- | repository.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/repository.go b/repository.go index bfbfebd..5313af3 100644 --- a/repository.go +++ b/repository.go @@ -62,6 +62,16 @@ func (v *Repository) Config() (*Config, error) { return config, nil } +func (v *Repository) Index() (*Index, error) { + var ptr *C.git_index + ret := C.git_repository_index(&ptr, v.ptr) + if ret < 0 { + return nil, LastError() + } + + return newIndexFromC(ptr), nil +} + func (v *Repository) LookupTree(oid *Oid) (*Tree, error) { tree := new(Tree) ret := C.git_tree_lookup(&tree.ptr, v.ptr, oid.toC()) |
