File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,19 @@ func (ro *RebaseOptions) toC() *C.git_rebase_options {
84
84
version : C .uint (ro .Version ),
85
85
quiet : C .int (ro .Quiet ),
86
86
inmemory : C .int (ro .InMemory ),
87
- rewrite_notes_ref : C . CString (ro .RewriteNotesRef ),
87
+ rewrite_notes_ref : rewriteNotesRefToC (ro .RewriteNotesRef ),
88
88
merge_options : * ro .MergeOptions .toC (),
89
89
checkout_options : * ro .CheckoutOptions .toC (),
90
90
}
91
91
}
92
92
93
+ func rewriteNotesRefToC (ref string ) * C.char {
94
+ if ref == "" {
95
+ return nil
96
+ }
97
+ return C .CString (ref )
98
+ }
99
+
93
100
// Rebase object wrapper for C pointer
94
101
type Rebase struct {
95
102
ptr * C.git_rebase
Original file line number Diff line number Diff line change @@ -143,6 +143,12 @@ func TestRebaseNoConflicts(t *testing.T) {
143
143
err = rebase .Finish ()
144
144
checkFatal (t , err )
145
145
146
+ // Check no more rebase is in progress
147
+ oRebase , err = repo .RebaseOpen (nil )
148
+ if err == nil {
149
+ t .Fatal ("Did not expect to find a rebase in progress" )
150
+ }
151
+
146
152
// Check history is in correct order
147
153
actualHistory , err := commitMsgsList (repo )
148
154
checkFatal (t , err )
You can’t perform that action at this time.
0 commit comments