From b75f6c05714ed5702c31fb67ef0ccd79c8b6ce0b Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 16 Dec 2022 14:28:40 -0700 Subject: [PATCH] fix: fail when the merge base is not found (#879) --- diff-sha.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 1b0af7cfd6c..fc529d6835d 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -270,12 +270,12 @@ else # shellcheck disable=SC2086 git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin $TARGET_BRANCH $CURRENT_SHA 1>/dev/null 2>&1 - - if ((i > max_depth)); then - echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_BRANCH with: $PREVIOUS_SHA$DIFF$CURRENT_SHA" - exit 1 - fi done + + if ((i > max_depth)); then + echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_BRANCH with: $PREVIOUS_SHA$DIFF$CURRENT_SHA" + exit 1 + fi else echo "::debug::Not a shallow clone, skipping merge-base check." fi