@@ -1359,11 +1359,15 @@ func TestGit(t *testing.T) {
13591359 as .NoError (gitCmd .Run (), "failed to init git repository" )
13601360
13611361 // run before adding anything to the index
1362+ // we should pick up untracked files since we use `git ls-files -o`
13621363 treefmt (t ,
13631364 withConfig (configPath , cfg ),
13641365 withNoError (t ),
13651366 withStats (t , map [stats.Type ]int {
1366- stats .Traversed : 0 ,
1367+ stats .Traversed : 31 ,
1368+ stats .Matched : 31 ,
1369+ stats .Formatted : 31 ,
1370+ stats .Changed : 0 ,
13671371 }),
13681372 )
13691373
@@ -1377,14 +1381,13 @@ func TestGit(t *testing.T) {
13771381 withStats (t , map [stats.Type ]int {
13781382 stats .Traversed : 31 ,
13791383 stats .Matched : 31 ,
1380- stats .Formatted : 31 ,
1384+ stats .Formatted : 0 ,
13811385 stats .Changed : 0 ,
13821386 }),
13831387 )
13841388
1385- // remove python directory from the index
1386- gitCmd = exec .Command ("git" , "rm" , "--cached" , "python/*" )
1387- as .NoError (gitCmd .Run (), "failed to remove python directory from the index" )
1389+ // remove python directory
1390+ as .NoError (os .RemoveAll (filepath .Join (tempDir , "python" )), "failed to remove python directory" )
13881391
13891392 // we should traverse and match against fewer files, but no formatting should occur as no formatting signatures
13901393 // are impacted
@@ -1411,8 +1414,8 @@ func TestGit(t *testing.T) {
14111414 withConfig (configPath , cfg ),
14121415 withNoError (t ),
14131416 withStats (t , map [stats.Type ]int {
1414- stats .Traversed : 79 ,
1415- stats .Matched : 79 ,
1417+ stats .Traversed : 76 ,
1418+ stats .Matched : 76 ,
14161419 stats .Formatted : 49 , // the echo formatter should only be applied to the new files
14171420 stats .Changed : 0 ,
14181421 }),
0 commit comments