diff --git a/racket/collects/pkg/private/checkout-credentials.rkt b/racket/collects/pkg/private/checkout-credentials.rkt index 50e2dcfc1b..4ec3a95f35 100644 --- a/racket/collects/pkg/private/checkout-credentials.rkt +++ b/racket/collects/pkg/private/checkout-credentials.rkt @@ -8,7 +8,7 @@ (define (call-with-git-checkout-credentials t) (let loop ([credentials-list (cons #f (get-git-checkout-credentials))]) (define credentials (first credentials-list)) - (with-handlers ([exn:fail? + (with-handlers ([exn:fail:git? (λ (x) (if (empty? (rest credentials-list)) (raise x) diff --git a/racket/collects/pkg/private/stage.rkt b/racket/collects/pkg/private/stage.rkt index 4867e57e35..d7bc7ec150 100644 --- a/racket/collects/pkg/private/stage.rkt +++ b/racket/collects/pkg/private/stage.rkt @@ -745,15 +745,23 @@ (git-checkout host #:port port repo #:dest-dir #f #:ref branch - #:status-printf (lambda (fmt . args) - (define (strip-ending-newline s) - (regexp-replace #rx"\n$" s "")) - (log-pkg-debug (strip-ending-newline (apply format fmt args)))) - #:initial-error (lambda () - (pkg-error (~a "Git checkout initial protocol failed;\n" - " the given URL might not refer to a Git repository\n" - " given URL: ~a") - pkg-url-str)) + #:status-printf + (lambda (fmt . args) + (define (strip-ending-newline s) + (regexp-replace #rx"\n$" s "")) + (log-pkg-debug + (strip-ending-newline (apply format fmt args)))) + #:initial-error + (lambda () + (raise + ;; This is a git error so that + ;; call-with-git-checkout-credentials will retry + (exn:fail:git + (~a "pkg: Git checkout initial protocol failed;\n" + " the given URL might not refer to a Git repository\n" + " given URL: " + pkg-url-str) + (current-continuation-marks)))) #:transport transport)))))] [(github) (match-define (list* user repo branch path)