3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-02-19 05:23:48 +00:00

feat: fallback to fork-point

This commit is contained in:
Tonye Jack 2022-12-15 12:20:18 -07:00
parent 3472a62032
commit 427b9f931d

View file

@ -248,15 +248,17 @@ else
for ((i=0; i<max_depth; i+=depth)); do
if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
break
else
PREVIOUS_SHA=$(git merge-base --fork-point "$PREVIOUS_SHA" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
fi
echo "Fetching $i commits..."
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin $TARGET_BRANCH $CURRENT_SHA 1>/dev/null 2>&1
done
if ((i > max_depth)); then
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