Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logical Issue in deepenShallowCloneToFindCommit #747

Closed
hi-artem opened this issue Nov 2, 2022 · 2 comments
Closed

Logical Issue in deepenShallowCloneToFindCommit #747

hi-artem opened this issue Nov 2, 2022 · 2 comments

Comments

@hi-artem
Copy link

hi-artem commented Nov 2, 2022

We have been using this action, and it periodically crashing while trying to deeper the shallow clone.

I am confused on the purpose of this loop:

while ! git diff "$base_ref$diff$ref" &>/dev/null; do
echo "::debug::Unable to find merge-base in shallow clone. Increasing depth to $((depth * 2))..."
depth=$((depth * 2))
if [[ $depth -gt $max_depth ]]; then
echo "::error::Unable to find merge-base in shallow clone. Please increase 'max_fetch_depth' to at least $((depth + 20))."
exit 1
fi
git fetch --no-tags -u --progress --deepen="$depth" origin "$target_branch":"$target_branch"
done

You can just deepen it to max_fetch_depth. AFAIK there are no performance benefits to deepening it multiple times.

Also with the current approach there is no way to reach the special depth of 2147483647, which according to docs is infinite:

The special depth 2147483647 (or 0x7fffffff, the largest positive number a signed 32-bit integer can contain) means infinite depth.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

@jackton1
Copy link
Member

jackton1 commented Nov 3, 2022

This function has been removed

@jackton1 jackton1 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants