Skip to content

Commit

Permalink
fix: pin initial branch to master (#1740)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Jan 20, 2021
1 parent d2ec893 commit 32a2c91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/helpers/git-utils.js
Expand Up @@ -25,8 +25,12 @@ const {GIT_NOTE_REF} = require('../../lib/definitions/constants');
*/
async function initGit(withRemote) {
const cwd = tempy.directory();
const args = withRemote ? ['--bare', '--initial-branch=master'] : ['--initial-branch=master'];

await execa('git', ['init', ...(withRemote ? ['--bare'] : [])], {cwd});
await execa('git', ['init', ...args], {cwd}).catch(() => {
const args = withRemote ? ['--bare'] : [];
return execa('git', ['init', ...args], {cwd});
});
const repositoryUrl = fileUrl(cwd);
return {cwd, repositoryUrl};
}
Expand Down

0 comments on commit 32a2c91

Please sign in to comment.