Commit df44f79b authored by Michele Carignani's avatar Michele Carignani
Browse files

fix text encoding for commit hash or tag

parent 83d54220
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ def get_git_log(folder: str):
    os.chdir(folder)
    gitcmd = ['git', 'log', '-n', '1', '--oneline', '--decorate']
    
    gitlog = subprocess.run(gitcmd, check=True, stdout=subprocess.PIPE).stdout
    gitlog = subprocess.run(gitcmd, check=True, stdout=subprocess.PIPE).stdout.decode("utf-8")
    
    if not isinstance(gitlog, str):
        gitlog = str(gitlog)
+6 −0
Original line number Diff line number Diff line
@@ -24,4 +24,10 @@ def test_parse_commit_from_log():
    assert crs.parse_commit_from_log(without_tag) == "023ca44"
    assert crs.parse_commit_from_log(wrong) is None

def test_get_git_reference():

    comm, reftype = crs.get_git_reference("..")

    assert comm is not None
    assert isinstance(comm, str)