Skip to content

Commit a788275

Browse files
sacca97copernico
authored andcommitted
added option to set tags during git output parsing (slow)
1 parent b76af70 commit a788275

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

prospector/git/git.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import shutil
1111
import subprocess
1212
import sys
13-
from typing import Dict, List
13+
from typing import Dict, List, Optional
1414
from urllib.parse import urlparse
1515

1616
import requests
@@ -286,14 +286,15 @@ def create_commits(
286286

287287
# TODO: problem -> twins can be merge commits, same commits for different branches, not only security related fixes
288288

289-
return self.parse_git_output(out, find_twins)
289+
return self.parse_git_output(out, find_twins, ancestors_of)
290290

291291
except Exception:
292292
logger.error("Git command failed, cannot get commits", exc_info=True)
293293
return dict()
294294

295-
def parse_git_output(self, raw: List[str], find_twins: bool = False):
296-
295+
def parse_git_output(
296+
self, raw: List[str], find_twins: bool = False, next_tag: Optional[str] = None
297+
):
297298
commits: Dict[str, RawCommit] = dict()
298299
commit = None
299300
sector = 0
@@ -303,6 +304,8 @@ def parse_git_output(self, raw: List[str], find_twins: bool = False):
303304
sector = 1
304305
if 0 < len(commit.changed_files) < 100:
305306
commit.msg = commit.msg.strip()
307+
# TODO: should work here
308+
# commit.set_tags(next_tag)
306309
if find_twins:
307310
commit.minhash = get_encoded_minhash(commit.msg[:50])
308311

0 commit comments

Comments
 (0)