Fix reference bug introduced with RebaseOptions implementation
This commit is contained in:
parent
adc3a4bd89
commit
03e10c5639
|
@ -84,12 +84,19 @@ func (ro *RebaseOptions) toC() *C.git_rebase_options {
|
|||
version: C.uint(ro.Version),
|
||||
quiet: C.int(ro.Quiet),
|
||||
inmemory: C.int(ro.InMemory),
|
||||
rewrite_notes_ref: C.CString(ro.RewriteNotesRef),
|
||||
rewrite_notes_ref: rewriteNotesRefToC(ro.RewriteNotesRef),
|
||||
merge_options: *ro.MergeOptions.toC(),
|
||||
checkout_options: *ro.CheckoutOptions.toC(),
|
||||
}
|
||||
}
|
||||
|
||||
func rewriteNotesRefToC(ref string) *C.char {
|
||||
if ref == "" {
|
||||
return nil
|
||||
}
|
||||
return C.CString(ref)
|
||||
}
|
||||
|
||||
// Rebase object wrapper for C pointer
|
||||
type Rebase struct {
|
||||
ptr *C.git_rebase
|
||||
|
|
|
@ -143,6 +143,12 @@ func TestRebaseNoConflicts(t *testing.T) {
|
|||
err = rebase.Finish()
|
||||
checkFatal(t, err)
|
||||
|
||||
// Check no more rebase is in progress
|
||||
oRebase, err = repo.RebaseOpen(nil)
|
||||
if err == nil {
|
||||
t.Fatal("Did not expect to find a rebase in progress")
|
||||
}
|
||||
|
||||
// Check history is in correct order
|
||||
actualHistory, err := commitMsgsList(repo)
|
||||
checkFatal(t, err)
|
||||
|
|
Loading…
Reference in New Issue