Skip to content

Commit 516ad51

Browse files
authored
Update fetchCommitPage to not specify Since (#53)
1 parent 8a4c509 commit 516ad51

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/gitlab.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ func (s *GitLab) FetchCommits(ctx context.Context, user *User, projectID int, si
119119
) ([]*Commit, error) {
120120
commits := make([]*Commit, 0, maxCommits)
121121

122-
if since.IsZero() {
123-
since = user.CreatedAt
124-
}
125-
126122
page := 1
127123
for page > 0 {
128124
cms, nextPage, err := s.fetchCommitPage(ctx, user, page, 100, since, projectID)
@@ -152,8 +148,11 @@ func (s *GitLab) fetchCommitPage(
152148
PerPage: perPage,
153149
Page: page,
154150
},
155-
Since: gitlab.Time(since),
156-
All: gitlab.Bool(true),
151+
All: gitlab.Bool(true),
152+
}
153+
154+
if !since.IsZero() {
155+
opt.Since = gitlab.Time(since)
157156
}
158157

159158
comms, resp, err := s.gitlabClient.Commits.ListCommits(projectID, opt, gitlab.WithContext(ctx))

0 commit comments

Comments
 (0)