@@ -15,7 +15,7 @@ import (
15
15
"github.com/stretchr/testify/require"
16
16
)
17
17
18
- func Test_Checker (t * testing.T ) {
18
+ func Test_CheckerLanguageStatus (t * testing.T ) {
19
19
setting .AppDataPath = t .TempDir ()
20
20
repoPath := "../tests/repos/language_stats_repo"
21
21
gitRepo , err := git .OpenRepository (t .Context (), repoPath )
@@ -57,8 +57,19 @@ func Test_Checker(t *testing.T) {
57
57
assert .Equal (t , expectedAttrs (), attrs ["i-am-a-python.p" ])
58
58
})
59
59
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
+
60
71
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 " )
62
73
return
63
74
}
64
75
0 commit comments