Skip to content

Commit

Permalink
fix: fetching latest version when using tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Dec 23, 2024
1 parent 0aae869 commit d633295
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nix_update/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,13 @@ def update_version(
else:
assert version.startswith("branch=")
branch = version[7:]
old_rev_tag = package.rev or package.tag
new_version = fetch_latest_version(
package.parsed_url,
preference,
version_regex,
branch,
package.rev,
old_rev_tag,
version_prefix,
)
package.new_version = new_version
Expand Down
4 changes: 2 additions & 2 deletions nix_update/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def fetch_latest_version(
preference: VersionPreference,
version_regex: str,
branch: str | None = None,
old_rev: str | None = None,
old_rev_tag: str | None = None,
version_prefix: str = "",
) -> Version:
unstable: list[str] = []
Expand Down Expand Up @@ -119,7 +119,7 @@ def fetch_latest_version(
None,
)

if ver is not None and ver.rev != old_rev:
if ver is not None and ver.rev != old_rev_tag:
return ver

return final[0]
Expand Down

0 comments on commit d633295

Please sign in to comment.