fix: recognize linguist language aliases (#39135)

Co-authored-by: loveulvu <ax9inl@google.com>
This commit is contained in:
Even
2026-08-26 23:24:07 +08:00
committed by GitHub
parent e21c37703e
commit 3005efa88d
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -225,6 +225,17 @@ func TestLinguist(t *testing.T) {
},
ExpectedLanguageOrder: []string{"YAML"},
},
// case 15: linguist-language alias should resolve to its canonical language
{
GitAttributesContent: "*.cpp linguist-language=golang",
FilesToAdd: []*files_service.ChangeRepoFile{
{
TreePath: "cplusplus.cpp",
ContentReader: strings.NewReader(cppContent),
},
},
ExpectedLanguageOrder: []string{"Go"},
},
}
for i, c := range cases {