Skip to content

Commit 8ea6232

Browse files
Read the bisect culprit as Git 2.55 logs it
Git 2.55 quotes the term in its bisect log, "# first 'bad' commit", so the test reads the line with or without the quotes. Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent 951f33e commit 8ea6232

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎tests/unit_tests/test_bisect.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ def actual(path, *args):
5858
run = subprocess.run(["git", "bisect", *args], cwd=path, capture_output=True, text=True)
5959
if "only 'skip'ped commits left" in run.stdout + run.stderr:
6060
return ("only-skipped", "")
61-
# the bisect log records the culprit the same way across Git versions,
62-
# where the message printed for it has changed
63-
m = re.search(r"^# first bad commit: \[([0-9a-f]{40})\]", git(path, "bisect", "log", check=False), re.M)
61+
# Git 2.55 quotes the term: "# first 'bad' commit: [sha]" in the log
62+
m = re.search(r"^# first '?bad'? commit: \[([0-9a-f]{40})\]", git(path, "bisect", "log", check=False), re.M)
6463
if m:
6564
return ("culprit", m.group(1)[:7])
6665
return ("next", git(path, "rev-parse", "--short=7", "HEAD").strip())

0 commit comments

Comments
 (0)