ResetDefaultToCommit maps git_reset_default #317
16
reset.go
16
reset.go
|
@ -24,3 +24,19 @@ func (r *Repository) ResetToCommit(commit *Commit, resetType ResetType, opts *Ch
|
||||||
}
|
}
|
||||||
return nil
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue