utils/git: add origin_branch
This commit is contained in:
parent
7d92454a56
commit
be92ef2889
@ -119,5 +119,10 @@ module Utils
|
|||||||
ENV["GIT_AUTHOR_EMAIL"] = Homebrew::EnvConfig.git_email if author
|
ENV["GIT_AUTHOR_EMAIL"] = Homebrew::EnvConfig.git_email if author
|
||||||
ENV["GIT_COMMITTER_EMAIL"] = Homebrew::EnvConfig.git_email if committer
|
ENV["GIT_COMMITTER_EMAIL"] = Homebrew::EnvConfig.git_email if committer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def origin_branch(repo)
|
||||||
|
Utils.popen_read("git", "-C", repo, "symbolic-ref", "-q", "--short",
|
||||||
|
"refs/remotes/origin/HEAD").chomp.presence
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user