r-lib / gitcreds

Query git credentials from R
https://gitcreds.r-lib.org/
Other
27 stars 10 forks source link

Selecting 1 (Keep these credentials) in `gitcreds_set()` throws an error #32

Closed batpigandme closed 2 years ago

batpigandme commented 3 years ago

@DavisVaughan confirmed as well. Everything works fine, and the PAT is set, but when selecting keep these credentials, an error is thrown (where I don't think there is one).

# -> What would you like to do? 

# 1: Keep these credentials
# 2: Replace these credentials
# 3: See the password / token

# Selection: 1
# Error in throw(new_error("gitcreds_abort_replace_error")) : 
#  User aborted updating credentials

Backtrace

# <error/rlang_error>
# User aborted updating credentials
# Backtrace:
#  1. gitcreds::gitcreds_set()
#  2. gitcreds:::gitcreds_set_replace(url, current)
#  3. gitcreds:::throw(new_error("gitcreds_abort_replace_error"))
gaborcsardi commented 2 years ago

This is as designed, we need to throw an error so upstream code knows that the credentials were not updated. We could say this in the menu, though:

1: Abort update and keep the existing credentials.
...