diff --git a/ext/system.py b/ext/system.py index 1b01065..1723e58 100644 --- a/ext/system.py +++ b/ext/system.py @@ -1,4 +1,3 @@ -import subprocess import asyncio import lightbulb @@ -25,7 +24,8 @@ async def get_git_branch(): return await create_subprocess("git", "rev-parse", "--abbrev-ref", "HEAD") async def get_git_remote(): - return await create_subprocess("git", "branch", "-r") + remote = await create_subprocess("git", "branch", "-vv") + return remote.split("[")[1].split("]")[0] async def get_git_head_diff_branch(branch: str) -> str: # diff HEAD to remote @@ -38,7 +38,6 @@ async def get_git_index_diff_branch(branch: str) -> str: async def get_git_commits_ahead_behind(branch: str, remote: str) -> tuple[int, int]: # commits ahead/behind remote output = await create_subprocess("git", "rev-list", "--left-right", "--count", branch+"..."+remote) - print("git_commmits_ahead:", output) commits_ahead = int(output.split()[0]) commits_behind = int(output.split()[1]) return commits_ahead, commits_behind