Skip to content

Commit

Permalink
Update diff-sha.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Nov 4, 2022
1 parent dc104b5 commit 0f09389
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions diff-sha.sh
Expand Up @@ -177,8 +177,12 @@ else

while ! git merge-base "$TARGET_BRANCH" "$CURRENT_BRANCH" > /dev/null; do
depth=$((depth+1024))

git fetch -q --deepen=$depth origin "$CURRENT_BRANCH":"$CURRENT_BRANCH"

if [[ -d .git/shallow ]]; then
git fetch -q --deepth=$depth --unshallow origin "$CURRENT_BRANCH":"$CURRENT_BRANCH"
else
git fetch -q --deepth=$depth origin "$CURRENT_BRANCH":"$CURRENT_BRANCH"
fi

if [[ $depth -gt 5000 ]]; then
echo "::error::Unable to locate the merge-base for: $TARGET_BRANCH $CURRENT_BRANCH"
Expand Down

0 comments on commit 0f09389

Please sign in to comment.