MCPcopy Create free account
hub / github.com/cloudflare/computer / GitClient

Interface GitClient

packages/computer/src/git/index.ts:232–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230
231/** Methods returned by `createGitClient`. */
232export interface GitClient {
233 /** Shallow-clone a remote into the bound workspace. */
234 clone(options: GitCloneOptions): Promise<void>;
235 /** Unified diff between a ref (default HEAD) and the working tree. */
236 diff(options?: GitDiffOptions): Promise<string>;
237 /** Per-file change summary backing `--stat` / `--name-only` / `--name-status`. */
238 diffSummary(options?: GitDiffOptions): Promise<DiffSummaryEntry[]>;
239 /** Initialise a new repository in the bound workspace. */
240 init(options?: GitInitOptions): Promise<void>;
241 /** Describe the working-tree / index / HEAD delta. */
242 status(options?: GitStatusOptions): Promise<StatusEntry[]>;
243 /** Stage paths into the index. */
244 add(options: GitAddOptions): Promise<void>;
245 /** Unstage paths from the index. */
246 rm(options: GitRmOptions): Promise<void>;
247 /** Write the current index to a new commit on HEAD. */
248 commit(options: GitCommitOptions): Promise<CommitResult>;
249 /** Walk commits from `ref` (default HEAD) backwards through history. */
250 log(options?: GitLogOptions): Promise<CommitView[]>;
251 /** Read a single commit by ref or oid. */
252 show(options: GitShowOptions): Promise<CommitView>;
253 /** Resolve a ref to its SHA-1 oid. */
254 revParse(options: GitRevParseOptions): Promise<string>;
255 /** Find the repository root by walking up from `dir`. */
256 repoRoot(options?: GitRepoRootOptions): Promise<string>;
257 /** Current branch name, or undefined on detached HEAD. */
258 currentBranch(options?: GitCurrentBranchOptions): Promise<string | undefined>;
259 /** List files in the index (or at a given ref). */
260 lsFiles(options?: GitLsFilesOptions): Promise<string[]>;
261 /** List one level of a tree (or sub-tree). */
262 lsTree(options: GitLsTreeOptions): Promise<TreeEntryView[]>;
263 /** Create a branch. */
264 branch(options: GitBranchOptions): Promise<void>;
265 /** Delete a branch. */
266 branchDelete(options: GitBranchDeleteOptions): Promise<void>;
267 /** List local branches. */
268 branchList(options?: GitBranchListOptions): Promise<string[]>;
269 /** Create a lightweight tag. */
270 tag(options: GitTagOptions): Promise<void>;
271 /** Delete a tag. */
272 tagDelete(options: GitTagDeleteOptions): Promise<void>;
273 /** List tags. */
274 tagList(options?: GitTagListOptions): Promise<string[]>;
275 /** Move HEAD to a ref, or update working-tree paths to a ref. */
276 checkout(options: GitCheckoutOptions): Promise<void>;
277 /** Fetch refs from a remote. */
278 fetch(options?: GitFetchOptions): Promise<FetchResult>;
279 /** Push local refs to a remote. */
280 push(options?: GitPushOptions): Promise<PushResult>;
281 /** Fetch and merge in one step. */
282 pull(options?: GitPullOptions): Promise<void>;
283 /** Merge a ref into the current branch (or `ours`). */
284 merge(options: GitMergeOptions): Promise<MergeResult>;
285 /** Add a named remote pointing at a URL. */
286 remoteAdd(options: GitRemoteAddOptions): Promise<void>;
287 /** Remove a named remote. */
288 remoteRemove(options: GitRemoteRemoveOptions): Promise<void>;
289 /** List configured remotes. */

Callers 137

index.test.tsFile · 0.65
runCloneFunction · 0.65
#callGitMethod · 0.65
index.test.tsFile · 0.80
runDiffFunction · 0.80
#callGitMethod · 0.80
diffSummaryFunction · 0.80
runDiffFunction · 0.80
network.test.tsFile · 0.65
initFunction · 0.65
initFunction · 0.65
initFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected