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 #90 from philippsimon/master
Browse files Browse the repository at this point in the history
Make git fetch fully compatible for version < 1.9
  • Loading branch information
gregberge committed Dec 27, 2015
2 parents 6567f83 + 3b17d08 commit 180d6bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tasks/deploy/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ module.exports = function (gruntOrShipit) {
function fetch() {
var fetchCommand = 'git fetch' +
(shipit.config.shallowClone ? ' --depth=1 ' : ' ') +
'shipit -p --tags';
'shipit --prune';

This comment has been minimized.

Copy link
@manuelbieh

manuelbieh Jan 25, 2016

This line breaks my deployment (see #105)

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

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

Expand Down
4 changes: 2 additions & 2 deletions test/unit/tasks/deploy/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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 shipit -p --tags', {cwd: '/tmp/workspace'});
expect(shipit.local).to.be.calledWith('git fetch shipit --prune && 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 All @@ -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 -p --tags', {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 checkout master', {cwd: '/tmp/workspace'});
expect(shipit.local).to.be.calledWith('git branch --list master', {cwd: '/tmp/workspace'});
done();
Expand Down

2 comments on commit 180d6bc

@matsu911
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks my deploy.
Seems like the issue is related to git version.
My git version is 1.8.3.1.

@bjoernsteinborn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for anybody? Can this be reverted or fixed?
Breaks for me too.
See also #108, #105.

Please sign in to comment.