diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-04-22 09:28:31 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-04-22 09:54:47 +0300 |
commit | 2b3d1a3bf75967db84795f00aad29cb0404ec4ed (patch) | |
tree | d38eb877c5316d2338fc93aad10009bca7c89250 /.golangci.yml | |
parent | a7bc2f86b507daaaf9f18e0ea189b062d6149720 (diff) |
commit: Handle real errors when skipping commits failed
When the user sets the `Offset` field of a FindCommits request, then we
effectively paginate the answer and only start returning commits after
this offset. But skipping commits can fail because of two reasons:
either because the user-provided offset is too large and there aren't
so many commits for the given file, or because a real error happened.
But right now, we're not checking any errors at all here.
Ignoring the first case where we do not have enough commits to satisfy
the request is an expected case, and we handle it just fine right now by
returning EOF. But the case where reading commits fails is a real error,
and we should report it to the caller when it has failed instead of just
returning EOF.
Fix the issue by having `GetCommits.Offset()` either return the error of
its scanner or an EOF if there are no more commits. Like this, we can
now do proper error checking in `findCommits()` and discern both cases.
Diffstat (limited to '.golangci.yml')
-rw-r--r-- | .golangci.yml | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/.golangci.yml b/.golangci.yml index 8fe3973f6..6c7f52edb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -795,10 +795,6 @@ issues: text: "Error return value of `cmd.Process.Kill` is not checked" - linters: - errcheck - path: "internal/gitaly/service/commit/find_commits.go" - text: "Error return value of `getCommits.Offset` is not checked" - - linters: - - errcheck path: "cmd/gitaly-git2go/main.go" text: "Error return value of `flags.Parse` is not checked" - linters: |