From 19e86cc60b215a3601e6bb5a28702bce8265451d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 15 Dec 2022 21:42:30 -0700 Subject: [PATCH] Update diff-sha.sh --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 5fa16a92..503343d6 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -165,7 +165,7 @@ else # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --depth=$(( GITHUB_EVENT_PULL_REQUEST_COMMITS + 1 )) origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" 1>/dev/null 2>&1 - COMMON_ANCESTOR=$(git rev-list --first-parent --max-parents=0 --max-count=1 origin/"$CURRENT_BRANCH") && exit_status=$? || exit_status=$? + COMMON_ANCESTOR=$(git rev-list --ancestry-path "$CURRENT_BRANCH".."$TARGET_BRANCH") && exit_status=$? || exit_status=$? if [[ -z "$COMMON_ANCESTOR" ]]; then echo "::debug::Unable to locate a common ancestor for the current branch: $CURRENT_BRANCH"