Skip to content

Fix tag comparison (numerical order)#1

Open
sgrimard wants to merge 1 commit intoatudomain:mainfrom
sgrimard:patch-1
Open

Fix tag comparison (numerical order)#1
sgrimard wants to merge 1 commit intoatudomain:mainfrom
sgrimard:patch-1

Conversation

@sgrimard
Copy link
Copy Markdown

@sgrimard sgrimard commented Sep 5, 2022

Tag comparison was done using alphabetical ordering instead of numerical ordering.
This won't work for releases that uses numbers over 9.
Casting each version component to an int will force numerical ordering.

The bug can easily be reproduced by creating a dummy repository and adding tags "0.9.0" and "0.10.0".
"0.9.0"will be seen as the latest by error.

Tag comparison was done using alphabetical ordering instead of numerical ordering.
This won't work for releases that uses numbers over 9.
Casting each version component to an int will force numerical ordering.

The bug can easily be reproduced by creating a dummy repository and adding tags "0.9.0" and "0.10.0".
"0.9.0"will be seen as the latest by error.
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.

1 participant