First implementation of authentication handling
This commit is contained in:
@@ -63,3 +63,20 @@ needed. Optional text can be supplied to Git with `#:input`.
|
||||
The result remains two values: Git's exit code and the ordered
|
||||
`(source line)` output items.
|
||||
|
||||
## Authentication retry
|
||||
|
||||
Authentication failures are detected centrally after `run-git`, before
|
||||
command-specific result processing. `current-git-authentication-handler`
|
||||
contains a callback that receives the command, processed arguments and an
|
||||
`exn:fail:git-auth` value. If the callback handles authentication and returns a
|
||||
true value, git-cli retries the original command once. The default callback
|
||||
returns `#f`, so existing error behavior is preserved until an authentication
|
||||
handler is configured.
|
||||
|
||||
```racket
|
||||
(current-git-authentication-handler
|
||||
(λ (cmd args e)
|
||||
;; Perform credential handling here.
|
||||
#t))
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user