File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,9 @@ impl SignBuilder {
156
156
String :: from ( "x509" ) ,
157
157
) ) ,
158
158
"ssh" => {
159
+ let program = config
160
+ . get_string ( "gpg.ssh.program" )
161
+ . unwrap_or_else ( |_| "ssh-keygen" . to_string ( ) ) ;
159
162
let ssh_signer = config
160
163
. get_string ( "user.signingKey" )
161
164
. ok ( )
@@ -178,7 +181,7 @@ impl SignBuilder {
178
181
"ssh key setting absent" ,
179
182
) )
180
183
} )
181
- . and_then ( SSHSign :: new) ?;
184
+ . and_then ( |key_path| SSHSign :: new ( program , key_path ) ) ?;
182
185
let signer: Box < dyn Sign > = Box :: new ( ssh_signer) ;
183
186
Ok ( signer)
184
187
}
@@ -282,7 +285,7 @@ pub struct SSHSign {
282
285
283
286
impl SSHSign {
284
287
/// Create new [`SSHDiskKeySign`] for sign.
285
- pub fn new ( mut key : PathBuf ) -> Result < Self , SignBuilderError > {
288
+ pub fn new ( program : String , mut key : PathBuf ) -> Result < Self , SignBuilderError > {
286
289
key. set_extension ( "" ) ;
287
290
if key. is_file ( ) {
288
291
#[ cfg( test) ]
@@ -294,7 +297,7 @@ impl SSHSign {
294
297
} )
295
298
. map ( |secret_key| Self {
296
299
#[ cfg( test) ]
297
- program : "ssh" . to_string ( ) ,
300
+ program,
298
301
#[ cfg( test) ]
299
302
key_path,
300
303
secret_key,
You can’t perform that action at this time.
0 commit comments