Documentation
¶
Overview ¶
Package gitremote is the seam between the mirror and the git remotes that it talks to: listing the refs of a remote and pushing refs to it. The mirror owns the interface. gitbin runs the git binary, and fakeremote keeps the refs in memory.
Index ¶
Constants ¶
const ( AskpassFileEnv = "WARD_ASKPASS_FILE" AskpassUserEnv = "WARD_ASKPASS_USER" )
Names of the environment variables that tell the askpass helper which file and user to answer with.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cred ¶
type Cred struct {
Header string
AskUser string
AskFile string
// KeepGC leaves gc.auto at its default, for the explicit maintenance command of a git run.
KeepGC bool
}
Cred is the credential of one run. Header is a complete HTTP header line. AskFile and AskUser feed the askpass helper.
type Error ¶
Error is a failure of a git run. Stderr is its error output, and TimedOut is true when the time limit ended it.
type PushSpec ¶
PushSpec is one ref of a push. An empty Commit deletes the ref. With LeaseSet, the push moves the ref only when the remote holds Lease, and an empty Lease means that the ref must be absent.
type Remote ¶
type Remote interface {
// List returns the refs of the remote under refs/ that name a commit, as git name to commit. It skips HEAD and peeled tags.
List(ctx context.Context, url string, c Cred) (map[string]string, error)
// Push sends the specs in one push from the repository at clone, and reports the outcome of each ref. A delete of a ref that
// the remote lacks is OK. An error means that the push as a whole failed.
Push(ctx context.Context, clone, url string, c Cred, specs []PushSpec) (map[string]Outcome, error)
}
Remote is a git remote.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fakeremote is a gitremote.Remote that keeps the refs of each URL in memory.
|
Package fakeremote is a gitremote.Remote that keeps the refs of each URL in memory. |
|
Package gitbin is the gitremote.Remote that runs the git binary with a clean environment.
|
Package gitbin is the gitremote.Remote that runs the git binary with a clean environment. |
|
Package remotetest is the conformance suite of gitremote.Remote.
|
Package remotetest is the conformance suite of gitremote.Remote. |