Skip to content
This repository has been archived by the owner on Mar 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #110 from bjoernsteinborn/issue-108
Browse files Browse the repository at this point in the history
Remove depth parameter from tags fetching
  • Loading branch information
gregberge committed Apr 30, 2016
2 parents e637e5e + 7d5fa60 commit 1afa2df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tasks/deploy/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ module.exports = function (gruntOrShipit) {
*/

function fetch() {
var fetchCommand = 'git fetch' +
(shipit.config.shallowClone ? ' --depth=1 ' : ' ') +
'shipit --prune';
var fetchCommand = 'git fetch shipit --prune';
var fetchDepth = shipit.config.shallowClone ? ' --depth=1' : '';

// fetch branches and tags separate to be compatible with git versions < 1.9
fetchCommand += ' && ' + fetchCommand + ' "refs/tags/*:refs/tags/*"';
fetchCommand += fetchDepth + ' && ' + fetchCommand + ' "refs/tags/*:refs/tags/*"';

shipit.log('Fetching repository "%s"', shipit.config.repositoryUrl);

Expand Down
2 changes: 1 addition & 1 deletion test/unit/tasks/deploy/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('deploy:fetch task', function () {
'git remote add shipit git://website.com/user/repo',
{cwd: '/tmp/workspace'}
);
expect(shipit.local).to.be.calledWith('git fetch --depth=1 shipit --prune && git fetch --depth=1 shipit --prune "refs/tags/*:refs/tags/*"', {cwd: '/tmp/workspace'});
expect(shipit.local).to.be.calledWith('git fetch shipit --prune --depth=1 && git fetch shipit --prune "refs/tags/*:refs/tags/*"', {cwd: '/tmp/workspace'});
expect(shipit.local).to.be.calledWith('git checkout master', {cwd: '/tmp/workspace'});
expect(shipit.local).to.be.calledWith('git branch --list master', {cwd: '/tmp/workspace'});
done();
Expand Down

0 comments on commit 1afa2df

Please sign in to comment.