diff options
| author | Carlos Martín Nieto <[email protected]> | 2016-08-27 21:07:44 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2016-08-27 21:07:44 +0200 |
| commit | aadd0c2035d12b6469c53b7c444ea6fe1006c2c0 (patch) | |
| tree | fd56478f8014dd41dcba043dc0677930d14c4b06 /reset.go | |
| parent | 37d3c2d9ad4c4e970cac02faec8ad184412c34e6 (diff) | |
| parent | 241aa34d83b210ceaab7029c46e05794f2ea9797 (diff) | |
Merge remote-tracking branch 'upstream/master' into next
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 +} |
