You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vendored git-auth.R will need a re-vendor if gitcreds renames the cache env var #484
One specific to pkgdepends: git_creds_for_url() writes "FAIL" to the computed name as a
negative cache, and gitcreds honors that sentinel by throwing before it asks git. So the variable
is a channel between the two copies, not just a user-facing string. r-lib/gitcreds#77 deliberately scopes
the sentinel to the canonical name, because honoring it under legacy names too would let a FAIL written here suppress a credential that is present:
library(gitcreds)
cfg<- tempfile()
writeLines(c(
"[credential]",
"\thelper = \"!f() { test \\\"$1\\\" = get && echo username=demo-user && echo password=real-token; }; f\""
), cfg)
url<-"https://gitlab.example.com"ev<- gitcreds_cache_envvar(url) #> "GITHUB_PAT_GITLAB_EXAMPLE_COM"withr::with_envvar(c(GIT_CONFIG_GLOBAL=cfg, GIT_CONFIG_NOSYSTEM="1"), {
gitcreds_get(url, use_cache=FALSE, set_cache=FALSE)$username#> [1] "demo-user" # the store has a good credentialwithr::with_envvar(structure(list("FAIL"), names=ev), gitcreds_get(url))
#> Error: Could not find any credentials
})
Worth noting that pak ships pkgdepends in a pinned private library, so the skew between the two
copies outlives a gitcreds upgrade in the user's own library.
Activity