@ -180,7 +180,7 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
// FIXME: Why can't we split this and the IsGenerated tests to avoid reading the blob unless absolutely necessary?
// FIXME: Why can't we split this and the IsGenerated tests to avoid reading the blob unless absolutely necessary?
// - eg. do the all the detection tests using filename first before reading content.
// - eg. do the all the detection tests using filename first before reading content.
language := analyze . GetCodeLanguage ( f . Name ( ) , content )
language := analyze . GetCodeLanguage ( f . Name ( ) , content )
if language == enry . OtherLanguage || language == "" {
if language == "" {
continue
continue
}
}
@ -192,8 +192,8 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
included , checked := includedLanguage [ language ]
included , checked := includedLanguage [ language ]
if ! checked {
if ! checked {
lang t ype := enry . GetLanguageType ( language )
lang T ype := enry . GetLanguageType ( language )
included = lang type == enry . Programming || langt ype == enry . Markup
included = lang Type == enry . Programming || langT ype == enry . Markup
includedLanguage [ language ] = included
includedLanguage [ language ] = included
}
}
if included {
if included {
@ -210,7 +210,7 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
sizes [ firstExcludedLanguage ] = firstExcludedLanguageSize
sizes [ firstExcludedLanguage ] = firstExcludedLanguageSize
}
}
return sizes , nil
return mergeLanguageStats ( sizes ) , nil
}
}
func discardFull ( rd * bufio . Reader , discard int64 ) error {
func discardFull ( rd * bufio . Reader , discard int64 ) error {