Skip to content
Snippets Groups Projects
Commit d611472d authored by Campbell Barton's avatar Campbell Barton
Browse files

Add sha1_short attribute to GitCommit object

parent 3d64648b
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,22 @@ class GitCommit: ...@@ -77,6 +77,22 @@ class GitCommit:
) )
return p.stdout.read() return p.stdout.read()
@property
def sha1_short(self):
cmd = (
"git",
"--git-dir",
self._git_dir,
"rev-parse",
"--short",
self.sha1,
)
p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
)
return p.stdout.read().strip().decode('ascii')
@property @property
def author(self): def author(self):
ret = self._author ret = self._author
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment