From 64a7c1f8213558f9aeaaa751492297e75463f656 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Thu, 2 Jun 2022 22:16:03 -0400 Subject: [PATCH] Git: Remove tags_only_debian logic The `tags_only_debian` code in livecheck's `Git` strategy was originally introduced in Homebrew/homebrew-livecheck#131 when livecheck was in a less mature state and relied more on internal special-casing like this (i.e., while we worked to add appropriate `livecheck` blocks). This logic only has the potential to be beneficial when a formula/cask doesn't contain a `livecheck` block but I would argue that we shouldn't be making assumptions in the strategy around whether tags with a `debian/` prefix should be matched or omitted. The answer depends upon the context of a given formula/cask and should be handled with a `livecheck` block, as we do with other situations like this. --- Library/Homebrew/livecheck/strategy/git.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy/git.rb b/Library/Homebrew/livecheck/strategy/git.rb index 5929460c56..42b944a16c 100644 --- a/Library/Homebrew/livecheck/strategy/git.rb +++ b/Library/Homebrew/livecheck/strategy/git.rb @@ -101,13 +101,7 @@ module Homebrew return Strategy.handle_block_return(block_return_value) end - tags_only_debian = tags.all? { |tag| tag.start_with?("debian/") } - tags.map do |tag| - # Skip tag if it has a 'debian/' prefix and upstream does not do - # only 'debian/' prefixed tags - next if tag =~ %r{^debian/} && !tags_only_debian - if regex # Use the first capture group (the version) tag.scan(regex).first&.first