git_repository: define #to_str
Fixes:
Error: no implicit conversion of GitRepository into String
when doing `brew pr-pull --autosquash`. See [1].
I contemplated implementing only `#to_s`, but we've historically used
these as `Pathname`s, and `Pathname` defines `#to_str`.
[1] https://github.com/Homebrew/homebrew-core/actions/runs/4784638305/jobs/8506369135#step:10:54
This commit is contained in:
parent
763c41f006
commit
93c3775147
@ -109,6 +109,12 @@ class GitRepository
|
||||
popen_git("log", "-1", "--pretty=%B", commit, "--", safe: safe, err: :out)&.strip
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
def to_str
|
||||
pathname.to_str
|
||||
end
|
||||
alias to_s to_str
|
||||
|
||||
private
|
||||
|
||||
sig { params(args: T.untyped, safe: T::Boolean, err: T.nilable(Symbol)).returns(T.nilable(String)) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user