Skip to content

Commit

Permalink
fix(roc-plugin-repo): Make sure we are working with a non shallow repo
Browse files Browse the repository at this point in the history
This solves some issues in CI servers, like Travis, where a shallow clone would be done that results in problems when trying to correctly bootstrap the repository.
  • Loading branch information
dlmr committed Dec 1, 2017
1 parent 84fe778 commit 21997dd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions extensions/roc-plugin-repo/src/semver/generateStatus.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { existsSync } from 'fs';

import conventionalChangelog from 'conventional-changelog';
import conventionalCommitsFilter from 'conventional-commits-filter';
import execa from 'execa';
import semver from 'semver';
import { upperCase } from 'lodash';
import log from 'roc/log/default/small';

import {
isBreakingChange,
Expand Down Expand Up @@ -34,6 +38,15 @@ export default async function generateStatus(
};
});

// Make sure we have all of the commits to be able to generate the right status
// if we are working with a shallow clone of the repository
if (existsSync('.git/shallow')) {
log.info(
'The git repository is shallow and will be unshallowed to work correctly.',
);
await execa('git', ['fetch', '--unshallow', '--tags'], { reject: false });
}

const latest = await getLatestCommitsSinceRelease(
'angular',
from,
Expand Down

0 comments on commit 21997dd

Please sign in to comment.