mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 15:30:40 +01:00
feat(git-prompt): show deleted files (#11245)
This commit is contained in:
@@ -44,7 +44,7 @@ if po.returncode != 0:
|
||||
sys.exit(0) # Not a git repository
|
||||
|
||||
# collect git status information
|
||||
untracked, staged, changed, conflicts = [], [], [], []
|
||||
untracked, staged, changed, deleted, conflicts = [], [], [], [], []
|
||||
ahead, behind = 0, 0
|
||||
status = [(line[0], line[1], line[2:]) for line in stdout.decode('utf-8').splitlines()]
|
||||
for st in status:
|
||||
@@ -75,13 +75,15 @@ for st in status:
|
||||
else:
|
||||
if st[1] == 'M':
|
||||
changed.append(st)
|
||||
if st[1] == 'D':
|
||||
deleted.append(st)
|
||||
if st[0] == 'U':
|
||||
conflicts.append(st)
|
||||
elif st[0] != ' ':
|
||||
staged.append(st)
|
||||
|
||||
stashed = get_stash()
|
||||
if not changed and not staged and not conflicts and not untracked:
|
||||
if not changed and not deleted and not staged and not conflicts and not untracked:
|
||||
clean = 1
|
||||
else:
|
||||
clean = 0
|
||||
@@ -95,6 +97,7 @@ out = ' '.join([
|
||||
str(len(changed)),
|
||||
str(len(untracked)),
|
||||
str(stashed),
|
||||
str(clean)
|
||||
str(clean),
|
||||
str(len(deleted))
|
||||
])
|
||||
print(out, end='')
|
||||
|
||||
Reference in New Issue
Block a user