@@ -28,7 +28,7 @@ fn straightforward() {
28
28
git_file_commit ( "b" , & td) ;
29
29
git ( & [ "checkout" , "-b" , "changes" , "HEAD~" ] , & td) ;
30
30
for n in & [ "c" , "d" , "e" ] {
31
- git_file_commit ( & n, & td) ;
31
+ git_file_commit ( n, & td) ;
32
32
}
33
33
34
34
let out = git_log ( & td) ;
@@ -49,7 +49,7 @@ fn straightforward() {
49
49
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
50
50
git ( & [ "add" , "new" ] , & td) ;
51
51
52
- fixup ( & td) . args ( & [ "-P" , "d" ] ) . output ( ) . unwrap ( ) ;
52
+ fixup ( & td) . args ( [ "-P" , "d" ] ) . output ( ) . unwrap ( ) ;
53
53
54
54
let shown = git_out (
55
55
& [ "diff-tree" , "--no-commit-id" , "--name-only" , "-r" , ":/d" ] ,
@@ -103,11 +103,11 @@ fn uses_merge_base_for_all_defaults() {
103
103
// default
104
104
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
105
105
git ( & [ "add" , "new" ] , & td) ;
106
- fixup ( & td) . args ( & [ "-P" , "b" ] ) . assert ( ) . failure ( ) ;
106
+ fixup ( & td) . args ( [ "-P" , "b" ] ) . assert ( ) . failure ( ) ;
107
107
// commits *after* the merge base of a default branch *do* get found by default
108
108
git ( & [ "reset" , "HEAD~" ] , & td) ;
109
109
git ( & [ "add" , "new" ] , & td) ;
110
- fixup ( & td) . args ( & [ "-P" , "f" ] ) . assert ( ) . success ( ) ;
110
+ fixup ( & td) . args ( [ "-P" , "f" ] ) . assert ( ) . success ( ) ;
111
111
}
112
112
}
113
113
@@ -137,7 +137,7 @@ fn simple_straightline_commits() {
137
137
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
138
138
git ( & [ "add" , "new" ] , & td) ;
139
139
140
- fixup ( & td) . args ( & [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
140
+ fixup ( & td) . args ( [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
141
141
142
142
let ( files, err) = git_changed_files ( "target" , & td) ;
143
143
@@ -185,7 +185,7 @@ fn stashes_before_rebase() {
185
185
let tracked_changed_files = git_worktree_changed_files ( & td) ;
186
186
assert_eq ! ( tracked_changed_files. trim( ) , edited_file) ;
187
187
188
- fixup ( & td) . args ( & [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
188
+ fixup ( & td) . args ( [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
189
189
190
190
let ( files, err) = git_changed_files ( "target" , & td) ;
191
191
@@ -235,7 +235,7 @@ fn test_no_commit_in_range() {
235
235
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
236
236
git ( & [ "add" , "new" ] , & td) ;
237
237
238
- let assertion = fixup ( & td) . args ( & [ "-P" , "b" ] ) . assert ( ) . failure ( ) ;
238
+ let assertion = fixup ( & td) . args ( [ "-P" , "b" ] ) . assert ( ) . failure ( ) ;
239
239
let out = string ( assertion. get_output ( ) . stdout . clone ( ) ) ;
240
240
let expected = "No commit contains the pattern" ;
241
241
assert ! (
@@ -245,7 +245,7 @@ fn test_no_commit_in_range() {
245
245
out
246
246
) ;
247
247
248
- fixup ( & td) . args ( & [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
248
+ fixup ( & td) . args ( [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
249
249
250
250
let ( files, err) = git_changed_files ( "target" , & td) ;
251
251
@@ -288,7 +288,7 @@ fn retarget_branches_in_range() {
288
288
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
289
289
git ( & [ "add" , "new" ] , & td) ;
290
290
291
- fixup ( & td) . args ( & [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
291
+ fixup ( & td) . args ( [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
292
292
293
293
let ( files, err) = git_changed_files ( "target" , & td) ;
294
294
@@ -339,7 +339,7 @@ fn retarget_branch_target_of_edit() {
339
339
td. child ( "new" ) . touch ( ) . unwrap ( ) ;
340
340
git ( & [ "add" , "new" ] , & td) ;
341
341
342
- fixup ( & td) . args ( & [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
342
+ fixup ( & td) . args ( [ "-P" , "target" ] ) . assert ( ) . success ( ) ;
343
343
344
344
let out = git_log ( & td) ;
345
345
assert_eq ! (
370
370
371
371
fn git_commits ( ids : & [ & str ] , tempdir : & assert_fs:: TempDir ) {
372
372
for n in ids {
373
- git_file_commit ( n, & tempdir) ;
373
+ git_file_commit ( n, tempdir) ;
374
374
}
375
375
}
376
376
@@ -379,16 +379,16 @@ fn git_init(tempdir: &assert_fs::TempDir) {
379
379
}
380
380
381
381
fn git_init_default_branch_name ( name : & str , tempdir : & assert_fs:: TempDir ) {
382
- git ( & [ "init" , "--initial-branch" , name] , & tempdir) ;
383
- git ( & [ "config" , "user.email" , "[email protected] " ] , & tempdir
) ;
384
- git ( & [ "config" , "user.name" , "nobody" ] , & tempdir) ;
382
+ git ( & [ "init" , "--initial-branch" , name] , tempdir) ;
383
+ git ( & [ "config" , "user.email" , "[email protected] " ] , tempdir
) ;
384
+ git ( & [ "config" , "user.name" , "nobody" ] , tempdir) ;
385
385
}
386
386
387
387
/// Create a file and commit it with a mesage that is just the name of the file
388
388
fn git_file_commit ( name : & str , tempdir : & assert_fs:: TempDir ) {
389
389
tempdir. child ( format ! ( "file_{}" , name) ) . touch ( ) . unwrap ( ) ;
390
- git ( & [ "add" , "-A" ] , & tempdir) ;
391
- git ( & [ "commit" , "-m" , & name] , & tempdir) ;
390
+ git ( & [ "add" , "-A" ] , tempdir) ;
391
+ git ( & [ "commit" , "-m" , & name] , tempdir) ;
392
392
}
393
393
394
394
/// Get the git shown output for the target commit
@@ -401,7 +401,7 @@ fn git_changed_files(name: &str, tempdir: &assert_fs::TempDir) -> (String, Strin
401
401
"-r" ,
402
402
& format ! ( ":/{}" , name) ,
403
403
] ,
404
- & tempdir,
404
+ tempdir,
405
405
) ;
406
406
( string ( out. stdout ) , string ( out. stderr ) )
407
407
}
@@ -421,7 +421,7 @@ fn git_out(args: &[&str], tempdir: &assert_fs::TempDir) -> Output {
421
421
422
422
fn git_log ( tempdir : & assert_fs:: TempDir ) -> String {
423
423
let mut s = String :: from_utf8 (
424
- git_inner ( & [ "log" , "--all" , "--format=%s %D" , "--graph" ] , & tempdir)
424
+ git_inner ( & [ "log" , "--all" , "--format=%s %D" , "--graph" ] , tempdir)
425
425
. output ( )
426
426
. unwrap ( )
427
427
. stdout ,
@@ -430,7 +430,7 @@ fn git_log(tempdir: &assert_fs::TempDir) -> String {
430
430
. lines ( )
431
431
. map ( |l| l. trim_end ( ) )
432
432
. join ( "\n " ) ;
433
- s. push_str ( " \n " ) ;
433
+ s. push ( '\n' ) ;
434
434
s
435
435
}
436
436
@@ -440,14 +440,14 @@ fn string(from: Vec<u8>) -> String {
440
440
441
441
fn git_inner ( args : & [ & str ] , tempdir : & assert_fs:: TempDir ) -> Command {
442
442
let mut cmd = Command :: new ( "git" ) ;
443
- cmd. args ( args) . current_dir ( & tempdir. path ( ) ) ;
443
+ cmd. args ( args) . current_dir ( tempdir. path ( ) ) ;
444
444
cmd
445
445
}
446
446
447
447
/// Get something that can get args added to it
448
448
fn fixup ( dir : & assert_fs:: TempDir ) -> Command {
449
449
let mut c = Command :: cargo_bin ( "git-instafix" ) . unwrap ( ) ;
450
- c. current_dir ( & dir. path ( ) )
450
+ c. current_dir ( dir. path ( ) )
451
451
. env_remove ( "GIT_INSTAFIX_UPSTREAM" ) ;
452
452
c
453
453
}
0 commit comments