Merge pull request #15300 from carlocab/git-repo-str

git_repository: implement `#to_s`
This commit is contained in:
Carlo Cabrera 2023-04-24 22:48:47 +08:00 committed by GitHub
commit 4f179c54a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -161,10 +161,10 @@ module Homebrew
package_name = package_file.basename.to_s.chomp(".rb")
odebug "Cherry-picking #{package_file}: #{commit}"
Utils::Git.cherry_pick!(git_repo, commit, verbose: verbose, resolve: resolve)
Utils::Git.cherry_pick!(git_repo.to_s, commit, verbose: verbose, resolve: resolve)
old_package = Utils::Git.file_at_commit(git_repo, file, "HEAD^")
new_package = Utils::Git.file_at_commit(git_repo, file, "HEAD")
old_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD^")
new_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD")
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason: reason).strip
subject, body, trailers = separate_commit_message(git_repo.commit_message)

View File

@ -109,6 +109,11 @@ class GitRepository
popen_git("log", "-1", "--pretty=%B", commit, "--", safe: safe, err: :out)&.strip
end
sig { returns(String) }
def to_s
pathname.to_s
end
private
sig { params(args: T.untyped, safe: T::Boolean, err: T.nilable(Symbol)).returns(T.nilable(String)) }