Git operations exposed over the Websocket.

These run through the backend's correlated fs:request protocol (see WispSocket.request).

Authentication: SSH remotes are authenticated server-side via a deploy key configured in the panel. HTTPS remotes can additionally use the GitHub token (ghToken) passed to WispInterface — pull and clone automatically retry with it when the remote reports auth_required.

Constructors

Properties

Methods

Constructors

Properties

socket: WispSocket

Methods

  • Clones a repository into the given parent directory.

    Parameters

    • url: string

      The repository URL to clone

    • directory: string

      The parent directory to clone into

    • Optional branch: string

      The branch to clone (optional)

    • timeout: number = 20000

      In milliseconds, how long to wait before timing out

    Returns Promise<GitCloneResult>

  • Performs a git pull on the given repository directory.

    Parameters

    • dir: string

      The full directory path to pull

    • timeout: number = 10000

      In milliseconds, how long to wait before timing out

    Returns Promise<GitPullResult>

  • Gets the git status of a directory (branch, commit, ahead/behind, dirty).

    Parameters

    • dir: string

      The full directory path of the repository

    • timeout: number = 10000

      In milliseconds, how long to wait before timing out

    Returns Promise<GitStatusResult>

  • Internal

    Runs a git op, retrying once with the configured GitHub token as authkey if the remote reports auth_required (an HTTPS remote with no credentials). SSH auth is handled server-side, so we only retry this specific case.

    Type Parameters

    • T

    Parameters

    • op: string
    • params: Record<string, any>
    • timeout: number

    Returns Promise<T>

Generated using TypeDoc