From 676b88c5c47c82399d3d5c991022551b05808a12 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 12 Jul 2022 19:30:52 +0100 Subject: [PATCH] dev-cmd/update-test: test against merge-base rather than latest master --- Library/Homebrew/dev-cmd/update-test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 4e090cc948..69bfe66f0f 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -52,7 +52,8 @@ module Homebrew "master" end - start_commit, end_commit = nil + start_commit = nil + end_commit = "HEAD" cd HOMEBREW_REPOSITORY do start_commit = if (commit = args.commit) commit @@ -79,14 +80,13 @@ module Homebrew # ^0 ensures this points to the commit rather than the tag object. "#{previous_tag}^0" else - Utils.popen_read("git", "rev-parse", "origin/master").chomp + Utils.popen_read("git", "merge-base", "origin/master", end_commit).chomp end odie "Could not find start commit!" if start_commit.empty? start_commit = Utils.popen_read("git", "rev-parse", start_commit).chomp odie "Could not find start commit!" if start_commit.empty? - end_commit ||= "HEAD" end_commit = Utils.popen_read("git", "rev-parse", end_commit).chomp odie "Could not find end commit!" if end_commit.empty?