Skip to content

Commit

Permalink
private-bower sometimes fails to refresh certain cached repositories …
Browse files Browse the repository at this point in the history
…due to merge conflicts. These come from forced changes of the source repository head. Since we don't need to have a straight commit line anyways, we can simply hard reset the head to origin/master. Fixes #171
  • Loading branch information
szabyg committed Nov 27, 2015
1 parent a45338c commit 9b9b90e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/service/repoCaches/gitRepoCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ module.exports = function GitRepoCache(options) {
if(fs.existsSync(packageDirPath)) {
fetchRepository()
.then(hardResetRepository)
.then(pullRepository)
.then(function() {
logger.log('Pulled latest for {0}'.format(path.basename(packageDirectory)));
resolve();
Expand All @@ -155,11 +154,7 @@ module.exports = function GitRepoCache(options) {
}

function hardResetRepository() {
return utils.exec('git reset --hard', packageDirPath);
}

function pullRepository() {
return utils.exec('git pull', packageDirPath);
return utils.exec('git reset --hard origin/master', packageDirPath);
}
}
}
Expand Down

0 comments on commit 9b9b90e

Please sign in to comment.