mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
handle detached HEAD
This commit is contained in:
parent
745eb19c39
commit
86522e18a7
1 changed files with 5 additions and 1 deletions
|
@ -20,7 +20,11 @@ def get_git_branch():
|
|||
except (subprocess.CalledProcessError, subprocess.TimeoutExpired):
|
||||
return None
|
||||
else:
|
||||
return status.split()[2].decode()
|
||||
status = status.decode().split()
|
||||
if status[2] == 'at':
|
||||
return status[3]
|
||||
else:
|
||||
return status[2]
|
||||
|
||||
def _get_parent_dir_for(path, dir_name, timeout):
|
||||
# walk up the directory tree to see if we are inside an hg repo
|
||||
|
|
Loading…
Add table
Reference in a new issue