diff options
| author | Mirko Nosenzo <[email protected]> | 2016-05-29 14:49:00 +0200 |
|---|---|---|
| committer | Mirko Nosenzo <[email protected]> | 2016-05-29 14:53:26 +0200 |
| commit | 8919236801226cf64fc42ccdaf420e00d590317a (patch) | |
| tree | 10a2cb32def228c87059284b27ccccafbc69f152 | |
| parent | 8eaae73f85dd3df78df80d2dac066eb0866444ae (diff) | |
ResetDefaultToCommit maps git_reset_default
Added support for default reset behavior
| -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 +} |
