fix GitPart
This commit is contained in:
parent
cd3dd70b45
commit
370ba5c576
1 changed files with 6 additions and 6 deletions
12
render.py
12
render.py
|
@ -324,19 +324,19 @@ class GitPart(Part):
|
|||
if branch_name:
|
||||
self.fragments.append("| ")
|
||||
|
||||
count_ahead = command("git log --oneline @{u}..").count("\n")
|
||||
count_behind = command("git log --oneline ..@{u}").count("\n")
|
||||
count_to_pull = command("git log --oneline ..@{u}").count("\n")
|
||||
count_to_push = command("git log --oneline @{u}..").count("\n")
|
||||
git_dir = command("git rev-parse --git-dir").strip()
|
||||
merging = os.path.exists(os.path.join(git_dir, "MERGE_HEAD"))
|
||||
untracked = command("git ls-files --other --exclude-standard").count("\n")
|
||||
modified = command("git diff --name-only").count("\n")
|
||||
staged = command("git diff --name-only --staged").count("\n")
|
||||
|
||||
if count_ahead:
|
||||
self.fragments.append("↘%d " %(count_ahead))
|
||||
if count_to_pull:
|
||||
self.fragments.append("↘%d " %(count_to_pull))
|
||||
|
||||
if count_behind:
|
||||
self.fragments.append("↗%d " %(count_behind))
|
||||
if count_to_push:
|
||||
self.fragments.append("↗%d " %(count_to_push))
|
||||
|
||||
if merging:
|
||||
self.fragments.append(style_color(COLOR_GIT_MERGE))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue