From 9b9b90e7fbafb88b3a1b1b962c5c268537dde3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Gr=C3=BCnwald?= Date: Fri, 27 Nov 2015 13:56:05 +0100 Subject: [PATCH] private-bower sometimes fails to refresh certain cached repositories 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 --- lib/service/repoCaches/gitRepoCache.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/service/repoCaches/gitRepoCache.js b/lib/service/repoCaches/gitRepoCache.js index 91f78e7..17b1432 100644 --- a/lib/service/repoCaches/gitRepoCache.js +++ b/lib/service/repoCaches/gitRepoCache.js @@ -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(); @@ -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); } } }