Skip to content

Commit

Permalink
Merge pull request #2254 from firedrakeproject/pefarrell/git-branch-s…
Browse files Browse the repository at this point in the history
…how-current

git branch --show-current not available in git < 2.22
  • Loading branch information
dham authored Oct 18, 2021
2 parents 4e4854c + 417cadc commit b04e9e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/firedrake-install
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def git_update(name, url=None):
if url:
_, plain_url, branch = split_requirements_url(url)
current_url = check_output(["git", "remote", "-v"]).split()[1]
current_branch = check_output(["git", "branch", "--show-current"]).strip()
current_branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip()
protocol = "https" if current_url.startswith("https") else "ssh"
new_url = git_url(plain_url, protocol)
# Ensure we only change from bitbucket to github and not the reverse.
Expand Down

0 comments on commit b04e9e7

Please sign in to comment.