@ -13,6 +13,7 @@ import (
"math"
"code.gitea.io/gitea/modules/analyze"
"code.gitea.io/gitea/modules/log"
"github.com/go-enry/go-enry/v2"
)
@ -34,19 +35,19 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
}
shaBytes , typ , size , err := ReadBatchLine ( batchReader )
if typ != "commit" {
lo g( "Unable to get commit for: %s. Err: %v" , commitID , err )
log . Debu g( "Unable to get commit for: %s. Err: %v" , commitID , err )
return nil , ErrNotExist { commitID , "" }
}
sha , err := NewIDFromString ( string ( shaBytes ) )
if err != nil {
lo g( "Unable to get commit for: %s. Err: %v" , commitID , err )
log . Debu g( "Unable to get commit for: %s. Err: %v" , commitID , err )
return nil , ErrNotExist { commitID , "" }
}
commit , err := CommitFromReader ( repo , sha , io . LimitReader ( batchReader , size ) )
if err != nil {
lo g( "Unable to get commit for: %s. Err: %v" , commitID , err )
log . Debu g( "Unable to get commit for: %s. Err: %v" , commitID , err )
return nil , err
}
if _ , err = batchReader . Discard ( 1 ) ; err != nil {
@ -79,7 +80,7 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
}
_ , _ , size , err := ReadBatchLine ( batchReader )
if err != nil {
lo g( "Error reading blob: %s Err: %v" , f . ID . String ( ) , err )
log . Debu g( "Error reading blob: %s Err: %v" , f . ID . String ( ) , err )
return nil , err
}