summaryrefslogtreecommitdiff
path: root/index.go
diff options
context:
space:
mode:
authorTobias Haar <[email protected]>2014-01-24 01:10:23 +0000
committerTobias Haar <[email protected]>2014-01-24 01:10:23 +0000
commit054268a63418b03892bfd4c6a509a0294660074b (patch)
tree8ec062a294b885e52324720723f4729bc274095c /index.go
parent66e1c476199ebcd3e304659992233132c5a52c6c (diff)
added write method
Diffstat (limited to 'index.go')
-rw-r--r--index.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/index.go b/index.go
index ac5148c..fb32010 100644
--- a/index.go
+++ b/index.go
@@ -49,6 +49,18 @@ func (v *Index) WriteTree() (*Oid, error) {
return oid, nil
}
+func (v *Index) Write() (error) {
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
+ ret := C.git_index_write(v.ptr)
+ if ret < 0 {
+ return LastError()
+ }
+
+ return nil
+}
+
func (v *Index) Free() {
runtime.SetFinalizer(v, nil)
C.git_index_free(v.ptr)