test 0.2.7a
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
(define collection "git")
|
(define collection "git")
|
||||||
(define pkg-desc "Command-line-like Git operations for Racket, implemented with libgit2")
|
(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 pkg-authors '("Hans Dijkema"))
|
||||||
(define license 'MIT)
|
(define license 'MIT)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"credentials.rkt"
|
"credentials.rkt"
|
||||||
libgit2)
|
libgit2)
|
||||||
|
|
||||||
; gewijzigd. Nog een keer.
|
; Again.
|
||||||
|
|
||||||
(provide git
|
(provide git
|
||||||
dgit
|
dgit
|
||||||
@@ -146,12 +146,14 @@
|
|||||||
0))
|
0))
|
||||||
callbacks)
|
callbacks)
|
||||||
|
|
||||||
(define (set-push-progress-callback! callbacks label quiet)
|
(define (set-push-progress-callback! callbacks _label _quiet)
|
||||||
(define report (make-progress-reporter label quiet #:bytes? #f))
|
;; 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!
|
(set-git_remote_callbacks-push_transfer_progress!
|
||||||
callbacks
|
callbacks
|
||||||
(lambda (current total bytes _payload)
|
(lambda (_current _total _bytes _payload)
|
||||||
(report current total bytes)
|
|
||||||
0))
|
0))
|
||||||
callbacks)
|
callbacks)
|
||||||
|
|
||||||
|
|||||||
@@ -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-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.
|
Remote HTTPS operations automatically use credentials from the @tt{racket-git} credential store when an entry exists for the remote host.
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -39,8 +39,12 @@
|
|||||||
(collect-garbage)
|
(collect-garbage)
|
||||||
(collect-garbage)
|
(collect-garbage)
|
||||||
(collect-garbage)
|
(collect-garbage)
|
||||||
(check-true (regexp-match? #rx"\\[git\\] push origin/master"
|
(define push-text (get-output-string push-out))
|
||||||
(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))
|
(define quiet-out (open-output-string))
|
||||||
(parameterize ([current-output-port quiet-out])
|
(parameterize ([current-output-port quiet-out])
|
||||||
(git 'push #:quiet #t))
|
(git 'push #:quiet #t))
|
||||||
|
|||||||
Reference in New Issue
Block a user