mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
[Backport 5.2] squirrel: Do case-insensitive comparison of file extensions (#58091)
squirrel: Do case-insensitive comparison of file extensions (#58069)
(cherry picked from commit bf65e1eb20)
Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
This commit is contained in:
parent
61c9fea3e3
commit
ca5b448a34
@ -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