From 2bd8664a58ea9cab4c64705381b1b3ec8cb88119 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Thu, 13 Jul 2017 13:34:28 -0700 Subject: [PATCH] use the latest HEAD/master of the official SwiftLint repo as 'master' otherwise, if forks have an out-of-date `master` branch, OSSCheck will be wildly inaccurate. --- script/oss-check | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/oss-check b/script/oss-check index c629b8723c..21c639f09c 100755 --- a/script/oss-check +++ b/script/oss-check @@ -236,6 +236,10 @@ def diff_and_report_changes_to_danger end end +def fetch_origin + `git fetch origin` +end + def clean_up FileUtils.rm_rf(@working_dir) perform('git worktree prune') @@ -267,8 +271,9 @@ $stdout.sync = true validate_state_to_run setup_repos make_directory_structure +fetch_origin -@effective_master_commitish = `git merge-base master #{@options[:branch]}` +@effective_master_commitish = `git merge-base origin/master #{@options[:branch]}` # Build & generate reports for branch & master %w[branch master].each do |branch|