Skip to content
Snippets Groups Projects
Commit be92ef28 authored by Seeker's avatar Seeker
Browse files

utils/git: add `origin_branch`

parent 7d92454a
No related branches found
No related tags found
Loading
......@@ -119,5 +119,10 @@ module Utils
ENV["GIT_AUTHOR_EMAIL"] = Homebrew::EnvConfig.git_email if author
ENV["GIT_COMMITTER_EMAIL"] = Homebrew::EnvConfig.git_email if committer
end
def origin_branch(repo)
Utils.popen_read("git", "-C", repo, "symbolic-ref", "-q", "--short",
"refs/remotes/origin/HEAD").chomp.presence
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment