* 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)
| 67 | * @return {Promise} A promise. |
| 68 | */ |
| 69 | function 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. |