File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ def get_commits(
7777 args : str = "" ,
7878) -> List [GitCommit ]:
7979 """Get the commits between start and end."""
80- git_log_cmd = f"git log --pretty={ log_format } { delimiter } { args } "
80+ git_log_cmd = (
81+ f"git -c log.showSignature=False log --pretty={ log_format } { delimiter } { args } "
82+ )
8183
8284 if start :
8385 c = cmd .run (f"{ git_log_cmd } { start } ..{ end } " )
Original file line number Diff line number Diff line change 11import inspect
2+ import shutil
23from typing import List , Optional
34
45import pytest
@@ -137,6 +138,27 @@ def test_get_commits_without_breakline_in_each_commit(mocker):
137138 )
138139
139140
141+ def test_get_commits_with_signature ():
142+ config_file = ".git/config"
143+ config_backup = ".git/config.bak"
144+ shutil .copy (config_file , config_backup )
145+
146+ try :
147+ # temporarily turn on --show-signature
148+ cmd .run ("git config log.showsignature true" )
149+
150+ # retrieve a commit that we know has a signature
151+ commit = git .get_commits (
152+ start = "bec20ebf433f2281c70f1eb4b0b6a1d0ed83e9b2" ,
153+ end = "9eae518235d051f145807ddf971ceb79ad49953a" ,
154+ )[0 ]
155+
156+ assert commit .title .startswith ("fix" )
157+ finally :
158+ # restore the repo's original config
159+ shutil .move (config_backup , config_file )
160+
161+
140162def test_get_tag_names_has_correct_arrow_annotation ():
141163 arrow_annotation = inspect .getfullargspec (git .get_tag_names ).annotations ["return" ]
142164
You can’t perform that action at this time.
0 commit comments