summaryrefslogtreecommitdiff
path: root/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'status.go')
-rw-r--r--status.go37
1 files changed, 14 insertions, 23 deletions
diff --git a/status.go b/status.go
index 3f5a06d..e68e6e9 100644
--- a/status.go
+++ b/status.go
@@ -25,6 +25,7 @@ const (
StatusWtTypeChange Status = C.GIT_STATUS_WT_TYPECHANGE
StatusWtRenamed Status = C.GIT_STATUS_WT_RENAMED
StatusIgnored Status = C.GIT_STATUS_IGNORED
+ StatusConflicted Status = C.GIT_STATUS_CONFLICTED
)
type StatusEntry struct {
@@ -126,34 +127,24 @@ type StatusOptions struct {
Pathspec []string
}
-func (opts *StatusOptions) toC() *C.git_status_options {
- if opts == nil {
- return nil
- }
-
- cpathspec := C.git_strarray{}
- if opts.Pathspec != nil {
- cpathspec.count = C.size_t(len(opts.Pathspec))
- cpathspec.strings = makeCStringsFromStrings(opts.Pathspec)
- defer freeStrarray(&cpathspec)
- }
-
- copts := &C.git_status_options{
- version: C.GIT_STATUS_OPTIONS_VERSION,
- show: C.git_status_show_t(opts.Show),
- flags: C.uint(opts.Flags),
- pathspec: cpathspec,
- }
-
- return copts
-}
-
func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) {
var ptr *C.git_status_list
var copts *C.git_status_options
if opts != nil {
- copts = opts.toC()
+ cpathspec := C.git_strarray{}
+ if opts.Pathspec != nil {
+ cpathspec.count = C.size_t(len(opts.Pathspec))
+ cpathspec.strings = makeCStringsFromStrings(opts.Pathspec)
+ defer freeStrarray(&cpathspec)
+ }
+
+ copts = &C.git_status_options{
+ version: C.GIT_STATUS_OPTIONS_VERSION,
+ show: C.git_status_show_t(opts.Show),
+ flags: C.uint(opts.Flags),
+ pathspec: cpathspec,
+ }
} else {
copts = &C.git_status_options{}
ret := C.git_status_init_options(copts, C.GIT_STATUS_OPTIONS_VERSION)