Commit 59605c33 authored by Francesco Witz's avatar Francesco Witz
Browse files

fix: tagged commit retrieving method

parent f9bbfe76
......@@ -117,14 +117,10 @@ def get_tagged_commit(version: str) -> str:
""" Method that get the hash of the commit tagged with the given version """
# First we run the git show commands by specifing the target version
cmd = subprocess.check_output(
['git', 'show', version, '--format=%h'], stderr=subprocess.STDOUT
['git', 'rev-list', '-n', '1', version, '--format=%h'], stderr=subprocess.STDOUT
).split(b'\n')
tag = [c.decode('utf-8') for c in cmd] # Decoding from byte to string
tag = [c.decode('utf-8') for c in cmd][1] # Decoding from byte to string and getting short hash
# Removing void string from the list
tag_lines: list[str] = []
for t in tag:
if t != '':
tag_lines.append(t)
return tag_lines[3] # Returning the hash of the specific commit
\ No newline at end of file
return tag
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment