@@ -126,34 +126,24 @@ type StatusOptions struct {
126
126
Pathspec []string
127
127
}
128
128
129
- func (opts * StatusOptions ) toC () * C.git_status_options {
130
- if opts == nil {
131
- return nil
132
- }
133
-
134
- cpathspec := C.git_strarray {}
135
- if opts .Pathspec != nil {
136
- cpathspec .count = C .size_t (len (opts .Pathspec ))
137
- cpathspec .strings = makeCStringsFromStrings (opts .Pathspec )
138
- defer freeStrarray (& cpathspec )
139
- }
140
-
141
- copts := & C.git_status_options {
142
- version : C .GIT_STATUS_OPTIONS_VERSION ,
143
- show : C .git_status_show_t (opts .Show ),
144
- flags : C .uint (opts .Flags ),
145
- pathspec : cpathspec ,
146
- }
147
-
148
- return copts
149
- }
150
-
151
129
func (v * Repository ) StatusList (opts * StatusOptions ) (* StatusList , error ) {
152
130
var ptr * C.git_status_list
153
131
var copts * C.git_status_options
154
132
155
133
if opts != nil {
156
- copts = opts .toC ()
134
+ cpathspec := C.git_strarray {}
135
+ if opts .Pathspec != nil {
136
+ cpathspec .count = C .size_t (len (opts .Pathspec ))
137
+ cpathspec .strings = makeCStringsFromStrings (opts .Pathspec )
138
+ defer freeStrarray (& cpathspec )
139
+ }
140
+
141
+ copts = & C.git_status_options {
142
+ version : C .GIT_STATUS_OPTIONS_VERSION ,
143
+ show : C .git_status_show_t (opts .Show ),
144
+ flags : C .uint (opts .Flags ),
145
+ pathspec : cpathspec ,
146
+ }
157
147
} else {
158
148
copts = & C.git_status_options {}
159
149
ret := C .git_status_init_options (copts , C .GIT_STATUS_OPTIONS_VERSION )
0 commit comments