MCPcopy
hub / github.com/tschaub/gh-pages / setupRemote

Function setupRemote

test/helper.js:69–82  ·  view source on GitHub ↗

* Creates a git repo with the contents of a fixture and pushes to a remote. * @param {string} fixtureName Name of the fixture. * @param {Object} options Repo options. * @return {Promise} A promise.

(fixtureName, options)

Source from the content-addressed store, hash-verified

67 * @return {Promise} A promise.
68 */
69function setupRemote(fixtureName, options) {
70 const branch = options.branch || 'gh-pages';
71 return setupRepo(fixtureName, options).then((dir) =>
72 mkdtemp()
73 .then((remote) => {
74 return new Git(remote).exec('init', '--bare').then(() => remote);
75 })
76 .then((remote) => {
77 const git = new Git(dir);
78 const url = 'file://' + remote;
79 return git.exec('push', url, branch).then(() => url);
80 }),
81 );
82}
83
84/**
85 * @param {string} dir The dir.

Callers

nothing calls this directly

Calls 2

setupRepoFunction · 0.85
mkdtempFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…