diff options
| author | Mirko Nosenzo <[email protected]> | 2016-10-08 11:33:56 +0200 |
|---|---|---|
| committer | Mirko Nosenzo <[email protected]> | 2016-10-08 11:33:56 +0200 |
| commit | 4567e4f7fa621df30e84ee643a27998776919b26 (patch) | |
| tree | 203c24d93683a2bda5bab19c578a2c108159337e /reset.go | |
| parent | 717a47f7547811622fb1c08c28262a8c63af96fe (diff) | |
| parent | 22091886372e73de5d66168e8665775676ec13c5 (diff) | |
Merge remote-tracking branch 'upstream/v24' into remote-refinements
Diffstat (limited to 'reset.go')
| -rw-r--r-- | reset.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 +} |
