MCPcopy
hub / github.com/dendronhq/dendron / remoteAdd

Method remoteAdd

packages/engine-test-utils/src/utils/git.ts:57–62  ·  view source on GitHub ↗

Adds a bare repository created with `createRemote` as the remote for the workspace. * * You'll probably want to just use `createRepoForRemoteWorkspace` instead, but this is provided if you are testing something it can't handle.

(wsRoot: string, remoteDir: string)

Source from the content-addressed store, hash-verified

55 * You'll probably want to just use `createRepoForRemoteWorkspace` instead, but this is provided if you are testing something it can't handle.
56 */
57 static async remoteAdd(wsRoot: string, remoteDir: string) {
58 const git = new Git({ localUrl: wsRoot, remoteUrl: remoteDir });
59 await git.remoteAdd();
60 // Need to push to be able to set up remote tracking branch
61 await git.push({ remote: "origin", branch: await git.getCurrentBranch() });
62 }
63
64 /** Set up a workspace with a remote, intended to be used when testing pull or push functionality.
65 *

Callers 2

Calls 3

remoteAddMethod · 0.95
pushMethod · 0.95
getCurrentBranchMethod · 0.95

Tested by

no test coverage detected