First implementation of authentication handling

This commit is contained in:
2026-08-13 17:03:48 +02:00
parent c90c407dce
commit 73084e69d9
6 changed files with 162 additions and 5 deletions
+17
View File
@@ -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))
```