IF Commons GitHub

physical/ref/remote

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-git-remote FR-001, 0005-git-remote FR-002, 0005-git-remote FR-003

The branch of a store, and only it, sent to a remote and brought back from one. A push is never forced: a remote that has commits the branch lacks refuses it, and that is a value, not a failure. A fetch reads the remote's branch into a private reference and moves the branch of the store only where that is a fast-forward; a branch that has diverged is left as it is and said so. The name of a remote is checked before Git sees it (no option, no line break, no transport that runs a program), and only the transports for files, SSH and the web are allowed.

Source: commons/anyfs-git/src/physical/ref/remote.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

Fetchedtypeno test imports it
type Fetched =
  | { readonly kind: "up-to-date"; readonly tip: string }
  | { readonly kind: "fast-forwarded"; readonly from: string | undefined; readonly to: string }
  | { readonly kind: "ahead"; readonly local: string; readonly remote: string }
  | { readonly kind: "diverged"; readonly local: string; readonly remote: string }
  | { readonly kind: "absent" };

What a fetch did: a closed union.

Pushedtypeno test imports it
type Pushed = { readonly remote: string; readonly branch: string; readonly tip: string };

What a push did.

RemoteProblemtypeno test imports it
type RemoteProblem =
  | { readonly kind: "no-branch"; readonly message: string }
  | { readonly kind: "rejected"; readonly message: string }
  | { readonly kind: "failed"; readonly message: string };

Why a push or a fetch did not do what was asked: a closed union.

remoteProblemfunction
function remoteProblem(remote: string): string | undefined

Why a text cannot be the name or address of a remote, or nothing where it can.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.