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 Dec 12, 2022
1 parent 17ae171 commit 8fb90ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions diff-sha.sh
Expand Up @@ -205,6 +205,10 @@ else
fi
else
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA

if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
fi
fi

if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
Expand All @@ -217,10 +221,10 @@ else
max_depth=$INPUT_MAX_FETCH_DEPTH

for ((i=0; i<max_depth; i+=depth)); do
echo "Fetching $depth commits..."
echo "Fetching $i commits..."

# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin "$CURRENT_BRANCH"
git fetch $EXTRA_ARGS -u --progress --deepen="$i" origin "$CURRENT_BRANCH"

if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
break
Expand Down

0 comments on commit 8fb90ed

Please sign in to comment.