| 141 | } |
| 142 | |
| 143 | func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) { |
| 144 | var ptr *C.git_status_list |
| 145 | var copts *C.git_status_options |
| 146 | |
| 147 | if opts != nil { |
| 148 | cpathspec := C.git_strarray{} |
| 149 | if opts.Pathspec != nil { |
| 150 | cpathspec.count = C.size_t(len(opts.Pathspec)) |
| 151 | cpathspec.strings = makeCStringsFromStrings(opts.Pathspec) |
| 152 | defer freeStrarray(&cpathspec) |
| 153 | } |
| 154 | |
| 155 | copts = &C.git_status_options{ |
| 156 | version: C.GIT_STATUS_OPTIONS_VERSION, |
| 157 | show: C.git_status_show_t(opts.Show), |
| 158 | flags: C.uint(opts.Flags), |
| 159 | pathspec: cpathspec, |
| 160 | } |
| 161 | } else { |
| 162 | copts = &C.git_status_options{} |
| 163 | ret := C.git_status_options_init(copts, C.GIT_STATUS_OPTIONS_VERSION) |
| 164 | if ret < 0 { |
| 165 | return nil, MakeGitError(ret) |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | runtime.LockOSThread() |
| 170 | defer runtime.UnlockOSThread() |
| 171 | |
| 172 | ret := C.git_status_list_new(&ptr, v.ptr, copts) |
| 173 | if ret < 0 { |
| 174 | return nil, MakeGitError(ret) |
| 175 | } |
| 176 | |
| 177 | return newStatusListFromC(ptr, v), nil |
| 178 | } |
| 179 | |
| 180 | func (v *Repository) StatusFile(path string) (Status, error) { |
| 181 | var statusFlags C.uint |