Skip to content
Permalink
Browse files
fix: pin initial branch to master (#1740)
  • Loading branch information
jsoref committed Jan 20, 2021
1 parent d2ec893 commit 32a2c91d7cf48e1119cbe97a6908f455455385fd
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/helpers/git-utils.js
@@ -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};
}

0 comments on commit 32a2c91

Please sign in to comment.