Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass: Get: remove redundant stat #323

Merged
merged 1 commit into from
May 10, 2024

Conversation

thaJeztah
Copy link
Member

listPassdir already handles "not found" errors, in which case it returns an empty result. Previously this would return a custom error, but since 1bb9aa3 (#321), an empty result produces a errCredentialsNotFound, making this check redundant.

This patch removes the redundant check.

- A picture of a cute animal (not mandatory but encouraged)

listPassdir already handles "not found" errors, in which case it returns
an [empty result][1]. Previously this would return a custom error, but
since 1bb9aa3, an empty result produces
a `errCredentialsNotFound`, making this check redundant.

This patch removes the redundant check.

[1]: https://github.com/docker/docker-credential-helpers/blob/f64d6b131b3da07a6337dc63a882e08ce541d1c1/pass/pass.go#L118-L125

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah self-assigned this May 10, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.28%. Comparing base (74840b3) to head (a14669f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   54.93%   55.28%   +0.35%     
==========================================
  Files           9        9              
  Lines         628      624       -4     
==========================================
  Hits          345      345              
+ Misses        237      234       -3     
+ Partials       46       45       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thaJeztah thaJeztah merged commit 6b9df3e into docker:master May 10, 2024
11 checks passed
@thaJeztah thaJeztah deleted the pass_simplify_get branch May 10, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants