Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only respond to credential get actions
Previously, the buildkite-agent git-credential-helper was responding to all git credential helper actions (get, store and erase). Whenever a GCH returns a value from a get action, git asks it to store that credential, in case the helper is capable of caching it. We aren't capable of caching, but but git would ask us to anyway, and we weren't checking the action type, so we'd go away and fetch another credential from buildkite, print it to stdout, and git would ignore it, wasting everyone's time and rate limits. This commit makes it so that if the GCH action isn't `get`, we'll silently ignore the request and do nothing. This is the [suggested practice](https://git-scm.com/docs/gitcredentials#Documentation/gitcredentials.txt-codegetcode:~:text=If%20it%20does%20not%20support%20the%20requested%20operation%20(e.g.%2C%20a%20read%2Donly%20store%20or%20generator)%2C%20it%20should%20silently%20ignore%20the%20request.) from the git docs.
- Loading branch information