test 0.2.7a

This commit is contained in:
2026-08-11 10:38:07 +02:00
parent 352d4e348a
commit baf0ef5868
4 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
(define collection "git")
(define pkg-desc "Command-line-like Git operations for Racket, implemented with libgit2")
(define version "0.2.6")
(define version "0.2.7")
(define pkg-authors '("Hans Dijkema"))
(define license 'MIT)
+7 -5
View File
@@ -8,7 +8,7 @@
"credentials.rkt"
libgit2)
; gewijzigd. Nog een keer.
; Again.
(provide git
dgit
@@ -146,12 +146,14 @@
0))
callbacks)
(define (set-push-progress-callback! callbacks label quiet)
(define report (make-progress-reporter label quiet #:bytes? #f))
(define (set-push-progress-callback! callbacks _label _quiet)
;; Diagnostic 0.2.7a: keep the libgit2 push progress callback installed,
;; but do no Racket I/O (or other synchronization) from callback context.
;; Racket CS runs FFI callbacks in atomic mode; writing to DrRacket's output
;; port from here can therefore crash the process during a real push.
(set-git_remote_callbacks-push_transfer_progress!
callbacks
(lambda (current total bytes _payload)
(report current total bytes)
(lambda (_current _total _bytes _payload)
0))
callbacks)
+2 -2
View File
@@ -109,9 +109,9 @@ Calls @racket[git], displays its result in a compact human-readable form, and re
@defproc[(git-pull [remote string? "origin"] [#:quiet quiet any/c #f]) (or/c string? #f)]{Fetches and performs a fast-forward-only update of the current branch. Returns the new OID, or @racket[#f] when already up to date. A non-fast-forward update raises an exception.}
@defproc[(git-push [remote string? "origin"] [branch (or/c string? #f) #f] [#:quiet quiet any/c #f]) void?]{Pushes a branch to a branch with the same name. With no positional arguments, the current branch is pushed to @tt{origin}; with only @racket[remote], the current branch is pushed there. Progress is written to the current output port unless @racket[quiet] is true.}
@defproc[(git-push [remote string? "origin"] [branch (or/c string? #f) #f] [#:quiet quiet any/c #f]) void?]{Pushes a branch to a branch with the same name. With no positional arguments, the current branch is pushed to @tt{origin}; with only @racket[remote], the current branch is pushed there. A start and completion message are written to the current output port unless @racket[quiet] is true. Transfer-percentage output is temporarily disabled so that no output is performed from the libgit2 push-progress callback.}
@defproc[(git-push-tag [tag string?] [remote string? "origin"] [#:quiet quiet any/c #f]) void?]{Pushes one tag. Progress is written to the current output port unless @racket[quiet] is true.}
@defproc[(git-push-tag [tag string?] [remote string? "origin"] [#:quiet quiet any/c #f]) void?]{Pushes one tag. A start and completion message are written to the current output port unless @racket[quiet] is true. Transfer-percentage output is temporarily disabled so that no output is performed from the libgit2 push-progress callback.}
Remote HTTPS operations automatically use credentials from the @tt{racket-git} credential store when an entry exists for the remote host.
+6 -2
View File
@@ -39,8 +39,12 @@
(collect-garbage)
(collect-garbage)
(collect-garbage)
(check-true (regexp-match? #rx"\\[git\\] push origin/master"
(get-output-string push-out)))
(define push-text (get-output-string push-out))
(check-true (regexp-match? #rx"\\[git\\] push origin/master" push-text))
(check-true (regexp-match? #rx"\\[git\\] push origin/master: done" push-text))
;; Push progress callbacks remain installed, but must not perform output
;; from FFI callback context. Percentage output would indicate a regression.
(check-false (regexp-match? #rx"%" push-text))
(define quiet-out (open-output-string))
(parameterize ([current-output-port quiet-out])
(git 'push #:quiet #t))