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

Add check that commit ID is valid hexadecimal #1740

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

Seb-MCaw
Copy link
Contributor

At present,

alr publish https://host.invalid/path/to/repo.git 0000000000000000000000000000000000000000

merely complains about the untrusted host (as it should), but

alr publish https://host.invalid/path/to/repo.git zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

yields a rather unhelpful

error: Dynamic_Predicate failed at alire-origins.adb:435
error: alr encountered an unexpected error, re-run with -d for details.

The same issue arises with commits specified in the [origin] section of index manifests.

This PR adds an explicit check for non-hexadecimal characters alongside the existing check for an incorrect number of characters, so the new error message is

error: Could not complete the publishing assistant:
error:    invalid git commit id, 40 digits hexadecimal expected

@Seb-MCaw Seb-MCaw marked this pull request as ready for review August 19, 2024 13:24
@Fabien-Chouteau Fabien-Chouteau merged commit d296745 into alire-project:master Aug 19, 2024
26 checks passed
@Seb-MCaw Seb-MCaw deleted the fix/Bad-commit-chars branch August 19, 2024 14:30
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

Successfully merging this pull request may close these issues.

2 participants