mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:51:44 +00:00
squirrel: Do case-insensitive comparison of file extensions (#58069)
This commit is contained in:
parent
c7ac58652b
commit
bf65e1eb20
@ -51,9 +51,7 @@
|
||||
"h++",
|
||||
"hh",
|
||||
"h",
|
||||
"hpp",
|
||||
"pc",
|
||||
"pcc"
|
||||
"hpp"
|
||||
],
|
||||
"csharp": [
|
||||
"cs",
|
||||
|
||||
@ -246,7 +246,10 @@ func (s *SquirrelService) parse(ctx context.Context, repoCommitPath types.RepoCo
|
||||
ext = strings.TrimPrefix(filepath.Ext(repoCommitPath.Path), ".")
|
||||
}
|
||||
|
||||
langName, ok := extToLang[ext]
|
||||
// It is not uncommon to have files with upper-case extensions
|
||||
// like .C, .H, .CPP etc., especially for code developed on
|
||||
// case-insensitive filesystems.
|
||||
langName, ok := extToLang[strings.ToLower(ext)]
|
||||
if !ok {
|
||||
return nil, unrecognizedFileExtensionError
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user