net/git-checkout: support "dumb" protocol for discovery

Supporting just reference discovery can be useful for certain
testing configurations.

original commit: 04f5fe3815
This commit is contained in:
Matthew Flatt 2014-11-21 07:00:18 -07:00
parent 72864cdd93
commit 1aee96df7d

View File

@ -7,7 +7,9 @@
@defmodule[net/git-checkout]{The @racketmodname[net/git-checkout] @defmodule[net/git-checkout]{The @racketmodname[net/git-checkout]
library provides support for extracting a directory tree from a Git library provides support for extracting a directory tree from a Git
repository that is hosted by a server that implements the @tt{git://} repository that is hosted by a server that implements the @tt{git://}
protocol or the ``smart'' protocol over HTTP(S). The protocol or the ``smart'' protocol over HTTP(S).@margin-note*{The
``dumb'' protocol over HTTP(S) is supported for reference discovery,
but not for obtaining repository content.} The
@racketmodname[net/git-checkout] library does not rely on external @racketmodname[net/git-checkout] library does not rely on external
binaries (such as a @exec{git} client) or Git-specific native binaries (such as a @exec{git} client) or Git-specific native
libraries (such as @filepath{libgit}).} libraries (such as @filepath{libgit}).}
@ -31,13 +33,14 @@ for information on command-line arguments and flags.
[#:tmp-dir given-tmp-dir (or/c #f path-string?) #f] [#:tmp-dir given-tmp-dir (or/c #f path-string?) #f]
[#:clean-tmp-dir? clean-tmp-dir? any/c (not given-tmp-dir)] [#:clean-tmp-dir? clean-tmp-dir? any/c (not given-tmp-dir)]
[#:verify-server? verify-server? any/c #t] [#:verify-server? verify-server? any/c #t]
[#:port port (integer-in 1 65535) (case transport [#:port port (or/c #f (integer-in 1 65535)) (case transport
[(git) 9418] [(git) 9418]
[(http) 80] [(http) 80]
[(https) 443])]) [(https) 443])])
string?]{ string?]{
Contacts the server at @racket[hostname] and @racket[port] Contacts the server at @racket[hostname] and @racket[port]
(where @racket[#f] is replaced by the default)
to download the repository whose name on the server is to download the repository whose name on the server is
@racket[repository] (normally ending in @filepath{.git}). The tree @racket[repository] (normally ending in @filepath{.git}). The tree
within the repository that is identified by @racket[ref] (which can be within the repository that is identified by @racket[ref] (which can be
@ -47,7 +50,9 @@ a branch, tag, commit ID, or tree ID) is extracted to
If @racket[transport] is @racket['git], then the server is contacted If @racket[transport] is @racket['git], then the server is contacted
using Git's native transport. If @racket[transport] is using Git's native transport. If @racket[transport] is
@racket['http] or @racket['https], then the server is contacted using @racket['http] or @racket['https], then the server is contacted using
HTTP(S) and the ``smart'' Git protocol. In the case of @racket['https], HTTP(S) and the ``smart'' Git protocol; if the server supports only
the ``dumb'' protocol, then @racket[dest-dir] must be @racket[#f]. In
the case of @racket['https],
the server's identity is verified unless @racket[verify-server?] is the server's identity is verified unless @racket[verify-server?] is
false or the @indexed-envvar{GIT_SSL_NO_VERIFY} environment variable false or the @indexed-envvar{GIT_SSL_NO_VERIFY} environment variable
is set. is set.