File tree 2 files changed +25
-1
lines changed 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ def get_commits(
77
77
args : str = "" ,
78
78
) -> List [GitCommit ]:
79
79
"""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
+ )
81
83
82
84
if start :
83
85
c = cmd .run (f"{ git_log_cmd } { start } ..{ end } " )
Original file line number Diff line number Diff line change 1
1
import inspect
2
+ import shutil
2
3
from typing import List , Optional
3
4
4
5
import pytest
@@ -137,6 +138,27 @@ def test_get_commits_without_breakline_in_each_commit(mocker):
137
138
)
138
139
139
140
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
+
140
162
def test_get_tag_names_has_correct_arrow_annotation ():
141
163
arrow_annotation = inspect .getfullargspec (git .get_tag_names ).annotations ["return" ]
142
164
You can’t perform that action at this time.
0 commit comments