@@ -15,7 +15,7 @@ import (
1515 "github.com/stretchr/testify/require"
1616)
1717
18- func Test_Checker (t * testing.T ) {
18+ func Test_CheckerLanguageStatus (t * testing.T ) {
1919 setting .AppDataPath = t .TempDir ()
2020 repoPath := "../tests/repos/language_stats_repo"
2121 gitRepo , err := git .OpenRepository (t .Context (), repoPath )
@@ -57,8 +57,19 @@ func Test_Checker(t *testing.T) {
5757 assert .Equal (t , expectedAttrs (), attrs ["i-am-a-python.p" ])
5858 })
5959
60+ t .Run ("Run git check-attr in bare repository using index" , func (t * testing.T ) {
61+ attrs , err := CheckAttributes (t .Context (), gitRepo , "" , CheckAttributeOpts {
62+ Filenames : []string {"i-am-a-python.p" },
63+ Attributes : LinguistAttributes ,
64+ Cached : true ,
65+ })
66+ assert .NoError (t , err )
67+ assert .Len (t , attrs , 1 )
68+ assert .Equal (t , expectedAttrs (), attrs ["i-am-a-python.p" ])
69+ })
70+
6071 if ! git .DefaultFeatures ().SupportCheckAttrOnBare {
61- t .Skip ("git version 2.40 is required to support run check-attr on bare repo" )
72+ t .Skip ("git version 2.40 is required to support run check-attr on bare repo without using index " )
6273 return
6374 }
6475
0 commit comments