mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
BazaarDownloadStrategy: Replace in-place sub
livecheck's `Git` strategy uses `DownloadStrategyDetector#detect` in its `#match?` method to check if a URL is a Git repository. This has historically worked fine but I've recently seen a `can't modify frozen String` error for a few formulae (percona-toolkit, schroedinger, squid) in relation to the in-place `sub` call in `BazaarDownloadStrategy`'s initializer. Other download strategies use a `@url = @url.sub(...)` pattern to avoid this issue, so this commit resolves the issue by using the same approach in `BazaarDownloadStrategy`.
This commit is contained in:
parent
01e0c20d01
commit
ec2a7121ab
@ -1277,7 +1277,7 @@ end
|
||||
class BazaarDownloadStrategy < VCSDownloadStrategy
|
||||
def initialize(url, name, version, **meta)
|
||||
super
|
||||
@url.sub!(%r{^bzr://}, "")
|
||||
@url = @url.sub(%r{^bzr://}, "")
|
||||
end
|
||||
|
||||
# @see AbstractDownloadStrategy#source_modified_time
|
||||
|
Loading…
x
Reference in New Issue
Block a user