File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ### Fixed
6+ - ` bashunit upgrade ` resolved the floating ` v0 ` Action tag as the latest version, breaking upgrades; it now only considers exact-version tags
7+
58## [ 0.39.0] ( https://github.com/TypedDevs/bashunit/compare/0.38.0...0.39.0 ) - 2026-06-09
69
710### Added
Original file line number Diff line number Diff line change @@ -322,10 +322,12 @@ function bashunit::helper::get_latest_tag() {
322322 return 1
323323 fi
324324
325+ # Floating major tags (e.g. v0) are not releases and must not win
325326 git ls-remote --tags " $BASHUNIT_GIT_REPO " |
326327 awk ' {print $2}' |
327328 sed ' s|^refs/tags/||' |
328329 grep -v ' \^{}' |
330+ grep -E ' ^[0-9]+\.[0-9]+(\.[0-9]+)?$' |
329331 sort -Vr |
330332 head -n 1
331333}
Original file line number Diff line number Diff line change 292292 unset -f git # remove the mock
293293}
294294
295+ function test_get_latest_tag_ignores_floating_major_tags() {
296+ bashunit::mock git << EOF
297+ fc9aac40eb8e5ad4483f08d79eb678a3650dcf78 refs/tags/0.38.0
298+ 3977be123b0b73cfdf4b4eff46b909f37aa83b3c refs/tags/0.39.0
299+ 9bb3726a1bf83fb09ca548a398762ab89baaa9b6 refs/tags/v0
300+ b546c693198870dd75d1a102b94f4ddad6f4f3ea refs/tags/v0^{}
301+ EOF
302+ assert_same " 0.39.0" " $( bashunit::helper::get_latest_tag) "
303+ unset -f git # remove the mock
304+ }
305+
295306function test_to_run_with_filter_matching_string_in_function_name() {
296307 local functions
297308 functions=(" test_my_awesome_function" " test_your_awesome_function" " test_so_lala_function" )
You can’t perform that action at this time.
0 commit comments