Skip to content

Commit

Permalink
fix: simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Oct 26, 2024
1 parent 0a13ea5 commit aa525ba
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions commit_lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ def _get_repo_owner_and_name():
res = subprocess.run(
["git", "remote", "get-url", "--push", "origin"],
shell=True,
capture_output=True,
check=True,
stdout=subprocess.PIPE,
text=True,
)
if res.returncode != 0:
raise RuntimeError("Could not get repo name:\n" + res.stderr)
parts = res.stdout.strip().split("/")
return parts[-2], parts[-1][: -len(".git")]

Expand All @@ -22,11 +21,10 @@ def _get_current_branch():
res = subprocess.run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
shell=True,
capture_output=True,
check=True,
stdout=subprocess.PIPE,
text=True,
)
if res.returncode != 0:
raise RuntimeError("Could not get current branch:\n" + res.stderr)
return res.stdout.strip()


Expand Down

0 comments on commit aa525ba

Please sign in to comment.