Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-06-07 11:09:06 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-06-10 09:34:46 +0300
commite5c66c287c13efaa237eac7720e8f9e8b3f94c52 (patch)
tree62cf6cbae21f9a51b0927b5183aad8fbd2f47f20
parente5725bc39cd011c7e896e670b551cbd668ffd3ab (diff)
cmd/gitaly-lfs-smudge: Don't return a reader when request fails
There is only a single caller of `smudgeOneObject()`, and that caller will immediately bubble up any errors returned by this function. It is thus needless to return an `io.NopCloser()` in case `smudgeOneObject()` itself fails. Return `nil` instead of the `io.NopCloser()` to clarify the code flow.
-rw-r--r--cmd/gitaly-lfs-smudge/smudge.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/gitaly-lfs-smudge/smudge.go b/cmd/gitaly-lfs-smudge/smudge.go
index 7b6d4f7cc..b5b720a87 100644
--- a/cmd/gitaly-lfs-smudge/smudge.go
+++ b/cmd/gitaly-lfs-smudge/smudge.go
@@ -54,7 +54,7 @@ func smudgeOneObject(ctx context.Context, cfg smudge.Config, gitlabClient *gitla
response, err := gitlabClient.Get(ctx, u.String())
if err != nil {
- return io.NopCloser(contents), fmt.Errorf("error loading LFS object: %v", err)
+ return nil, fmt.Errorf("error loading LFS object: %v", err)
}
if response.StatusCode == 200 {