diff --git a/internal/git/git.go b/internal/git/git.go index df5bb42..b28b0f5 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -83,9 +83,19 @@ func GetRepoContributors() ([]string, error) { return nil, err } - contributors := strings.Split(string(out), "\r\n") + toRemove := []int{} + contributors := strings.Split(string(out), "\n") for index, contributor := range contributors { - contributors[index] = strings.TrimSpace(contributor[strings.IndexByte(contributor, '\t'):]) + tabIndex := strings.IndexByte(contributor, '\t') + if tabIndex == -1 { + toRemove = append(toRemove, index) + continue + } + contributors[index] = strings.TrimSpace(contributor[tabIndex:]) + } + + for _, index := range toRemove { + contributors = append(contributors[:index], contributors[index+1:]...) } return contributors, nil