mirror of
https://github.com/tj-actions/changed-files
synced 2024-09-19 23:41:13 +02:00
fix: error finding merge base (#1077)
This commit is contained in:
parent
b109d82bbf
commit
b109d83a62
|
@ -251,13 +251,13 @@ else
|
||||||
|
|
||||||
if [[ "$IS_SHALLOW" == "true" ]]; then
|
if [[ "$IS_SHALLOW" == "true" ]]; then
|
||||||
# check if the merge base is in the local history
|
# check if the merge base is in the local history
|
||||||
if ! git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 1>/dev/null 2>&1; then
|
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
echo "::debug::Merge base is not in the local history, fetching remote target branch..."
|
echo "::debug::Merge base is not in the local history, fetching remote target branch..."
|
||||||
# Fetch more of the target branch history until the merge base is found
|
# Fetch more of the target branch history until the merge base is found
|
||||||
for i in {1..10}; do
|
for i in {1..10}; do
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
|
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH" 1>/dev/null
|
||||||
if git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 1>/dev/null 2>&1; then
|
if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo "::debug::Merge base is not in the local history, fetching remote target branch again..."
|
echo "::debug::Merge base is not in the local history, fetching remote target branch again..."
|
||||||
|
|
Loading…
Reference in a new issue