Commit 515b31d
committed
bump: fix newer_than_upstream comparison
The `newer_than_upstream` booleans can be incorrect when there's one
current version but multiple new versions or vice versa. This occurs
because the related comparisons are strictly done between the same
`BumpVersionParser` values and it doesn't work as expected in this
scenario (i.e., the `:arm`/`:intel` values are `nil` when `:general`
is used for the version and vice versa).
This adds additional logic to define which comparisons are used
depending on whether the current and/or new versions have multiple
versions, notably comparing against the `:general` version when
there's a difference between current and new. One caveat is that
`bump` will fall back to the `newer_than_upstream[:arm]` value when
the current version uses one version and `:general` isn't present
(as is the case when `multiple_versions[:new]` is true) but this
aligns with other usage of ARM as the favored arch in `bump` and
`bump-cask-pr`. This isn't the most elegant solution overall but it
works as expected (I wasn't able to achieve the same result through
more modest modifications, not to say that it's not possible).1 parent ef2e8ce commit 515b31d
1 file changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
408 | 422 | | |
409 | | - | |
410 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
411 | 428 | | |
412 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
413 | 436 | | |
414 | | - | |
415 | 437 | | |
416 | 438 | | |
417 | 439 | | |
| |||
497 | 519 | | |
498 | 520 | | |
499 | 521 | | |
500 | | - | |
| 522 | + | |
501 | 523 | | |
502 | 524 | | |
503 | 525 | | |
| |||
0 commit comments