File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,8 @@ impl Sign for GPGSign {
270
270
271
271
/// Sign commit data using `SSHDiskKeySign`
272
272
pub struct SSHSign {
273
+ #[ cfg( test) ]
274
+ program : String ,
273
275
#[ cfg( test) ]
274
276
key_path : String ,
275
277
secret_key : PrivateKey ,
@@ -288,6 +290,8 @@ impl SSHSign {
288
290
PrivateKey :: from_openssh ( bytes) . ok ( )
289
291
} )
290
292
. map ( |secret_key| Self {
293
+ #[ cfg( test) ]
294
+ program : "ssh" . to_string ( ) ,
291
295
#[ cfg( test) ]
292
296
key_path,
293
297
secret_key,
@@ -319,7 +323,7 @@ impl Sign for SSHSign {
319
323
320
324
#[ cfg( test) ]
321
325
fn program ( & self ) -> & String {
322
- "ssh"
326
+ & self . program
323
327
}
324
328
325
329
#[ cfg( test) ]
@@ -408,6 +412,7 @@ mod tests {
408
412
let sign =
409
413
SignBuilder :: from_gitconfig ( & repo, & repo. config ( ) ?) ?;
410
414
415
+ assert_eq ! ( "FFAA" , sign. signing_key( ) ) ;
411
416
Ok ( ( ) )
412
417
}
413
418
@@ -425,7 +430,7 @@ mod tests {
425
430
SignBuilder :: from_gitconfig ( & repo, & repo. config ( ) ?) ?;
426
431
427
432
assert_eq ! ( "ssh" , sign. program( ) ) ;
428
- assert_eq ! ( "/tmp/key" , sign. signing_key( ) ) ;
433
+ assert_eq ! ( "/tmp/key.pub " , sign. signing_key( ) ) ;
429
434
430
435
Ok ( ( ) )
431
436
}
You can’t perform that action at this time.
0 commit comments