From 9e81a47d5c7ac2fae4736e8853f72d7eecc80a60 Mon Sep 17 00:00:00 2001 From: "Philip Wellnitz [11]" Date: Wed, 25 Sep 2024 21:39:31 +0900 Subject: [PATCH] fix 0 commit id for git repos --- powerline/lib/vcs/git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/powerline/lib/vcs/git.py b/powerline/lib/vcs/git.py index 8adebb1bd..6e9deee42 100644 --- a/powerline/lib/vcs/git.py +++ b/powerline/lib/vcs/git.py @@ -225,7 +225,8 @@ def do_ahead_behind(self): repo = self._repo() try: - res = repo.ahead_behind(repo.head.target, repo.revparse_single('@{upstream}').hex) + res = repo.ahead_behind(repo.head.target, + repo.revparse_single('@{upstream}').id) except KeyError: res = (0, 0) return {'AHEAD': res[0], 'BEHIND': res[1]} @@ -233,7 +234,7 @@ def do_ahead_behind(self): @property def short(self): #TODO: Don't fix the length of the prefix - return self._repo().head.target.hex[:7] + return self._repo().head.target.__str__()[:7] @property def summary(self):