From ba773bad5587e45f3d16006862d4f951a1552b4d Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 5 Oct 2017 15:32:38 +0100 Subject: [PATCH] ci: fix fetching master into master --- scripts/test-commit-messages.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/test-commit-messages.js b/scripts/test-commit-messages.js index 223fd425e8..10d456a30f 100644 --- a/scripts/test-commit-messages.js +++ b/scripts/test-commit-messages.js @@ -33,14 +33,17 @@ logger // Note: This is based on the gulp task found in the angular/angular repository execSync('git fetch origin'); -// Travis doesn't have master when running jobs on other branches (minor/patch/etc). -execSync('git fetch origin master:master --force'); // Get PR target branch, default to master for running locally. const currentBranch = process.env.TRAVIS_BRANCH || process.env.APPVEYOR_REPO_BRANCH || 'master'; +if (currentBranch !== 'master') { + // Travis doesn't have master when running jobs on other branches (minor/patch/etc). + execSync('git fetch origin master:master --force'); +} + const output = execSync('git log ' + currentBranch + '..HEAD --reverse --format="%H %s" --no-merges', { encoding: 'utf-8' });