utils/git: remove redundant current_branch
This commit is contained in:
parent
5bda84b594
commit
d802b3755a
@ -385,7 +385,7 @@ module Homebrew
|
|||||||
_, user, repo, pr = *url_match
|
_, user, repo, pr = *url_match
|
||||||
odie "Not a GitHub pull request: #{arg}" unless pr
|
odie "Not a GitHub pull request: #{arg}" unless pr
|
||||||
|
|
||||||
current_branch = Utils::Git.current_branch(tap.path)
|
current_branch = tap.path.git_branch
|
||||||
origin_branch = Utils::Git.origin_branch(tap.path).split("/").last
|
origin_branch = Utils::Git.origin_branch(tap.path).split("/").last
|
||||||
|
|
||||||
if current_branch != origin_branch || args.branch_okay? || args.clean?
|
if current_branch != origin_branch || args.branch_okay? || args.clean?
|
||||||
|
|||||||
@ -140,7 +140,8 @@ module Utils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def current_branch(repo)
|
def current_branch(repo)
|
||||||
Utils.popen_read("git", "-C", repo, "symbolic-ref", "--short", "HEAD").chomp.presence
|
odeprecated "Utils::Git.current_branch(repo)", "Pathname(repo).git_branch"
|
||||||
|
Pathname(repo).extend(GitRepositoryExtension).git_branch
|
||||||
end
|
end
|
||||||
|
|
||||||
# Special case of `git cherry-pick` that permits non-verbose output and
|
# Special case of `git cherry-pick` that permits non-verbose output and
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user