Skip to content

Commit a14669f

Browse files
committed
pass: Get: remove redundant stat
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]>
1 parent 74840b3 commit a14669f

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

pass/pass.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ func (p Pass) Get(serverURL string) (string, string, error) {
142142
}
143143

144144
encoded := encodeServerURL(serverURL)
145-
146-
if _, err := os.Stat(path.Join(getPassDir(), PASS_FOLDER, encoded)); err != nil {
147-
if os.IsNotExist(err) {
148-
return "", "", credentials.NewErrCredentialsNotFound()
149-
}
150-
151-
return "", "", err
152-
}
153-
154145
usernames, err := listPassDir(encoded)
155146
if err != nil {
156147
return "", "", err

0 commit comments

Comments
 (0)