fix: use git ls-remote to verify if the remote branch is ahead

This commit is contained in:
Pierre Vanduynslager
2018-06-15 16:16:55 -04:00
parent 24a8052038
commit 2b6378f26f
6 changed files with 35 additions and 31 deletions
+5 -2
View File
@@ -15,7 +15,6 @@ import {
gitRemoteTagHead,
push,
gitShallowClone,
reset,
} from './helpers/git-utils';
// Save the current process.env
@@ -645,11 +644,15 @@ test.serial('Returns falsy value if triggered by a PR', async t => {
test.serial('Returns falsy value if triggered on an outdated clone', async t => {
// Create a git repository, set the current working directory at the root of the repo
const repositoryUrl = await gitRepo(true);
const repoDir = process.cwd();
// Add commits to the master branch
await gitCommits(['First']);
await gitCommits(['Second']);
await push();
await reset();
await gitShallowClone(repositoryUrl);
await gitCommits(['Third']);
await push();
process.chdir(repoDir);
const semanticRelease = proxyquire('..', {
'./lib/logger': t.context.logger,