summaryrefslogtreecommitdiff
path: root/reset.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2016-08-27 21:07:44 +0200
committerCarlos Martín Nieto <[email protected]>2016-08-27 21:07:44 +0200
commitaadd0c2035d12b6469c53b7c444ea6fe1006c2c0 (patch)
treefd56478f8014dd41dcba043dc0677930d14c4b06 /reset.go
parent37d3c2d9ad4c4e970cac02faec8ad184412c34e6 (diff)
parent241aa34d83b210ceaab7029c46e05794f2ea9797 (diff)
Merge remote-tracking branch 'upstream/master' into next
Diffstat (limited to 'reset.go')
-rw-r--r--reset.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/reset.go b/reset.go
index 9da7625..031f5bd 100644
--- a/reset.go
+++ b/reset.go
@@ -24,3 +24,19 @@ func (r *Repository) ResetToCommit(commit *Commit, resetType ResetType, opts *Ch
}
return nil
}
+
+func (r *Repository) ResetDefaultToCommit(commit *Commit, pathspecs []string) error {
+ cpathspecs := C.git_strarray{}
+ cpathspecs.count = C.size_t(len(pathspecs))
+ cpathspecs.strings = makeCStringsFromStrings(pathspecs)
+ defer freeStrarray(&cpathspecs)
+
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+ ret := C.git_reset_default(r.ptr, commit.ptr, &cpathspecs)
+
+ if ret < 0 {
+ return MakeGitError(ret)
+ }
+ return nil
+}