Skip to content

Commit baf8825

Browse files
committed
Fix builg gogit
1 parent a9ce76d commit baf8825

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/git/languagestats/language_stats_gogit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"io"
1111

1212
"code.gitea.io/gitea/modules/analyze"
13-
"code.gitea.io/gitea/modules/git"
13+
git_module "code.gitea.io/gitea/modules/git"
1414
"code.gitea.io/gitea/modules/git/attribute"
1515
"code.gitea.io/gitea/modules/optional"
1616

@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
// GetLanguageStats calculates language stats for git repository at specified commit
24-
func GetLanguageStats(repo *git.Repository, commitID string) (map[string]int64, error) {
24+
func GetLanguageStats(repo *git_module.Repository, commitID string) (map[string]int64, error) {
2525
r, err := git.PlainOpen(repo.Path)
2626
if err != nil {
2727
return nil, err
@@ -42,11 +42,11 @@ func GetLanguageStats(repo *git.Repository, commitID string) (map[string]int64,
4242
return nil, err
4343
}
4444

45-
checker, deferable, err := attribute.NewBatchChecker(repo, commitID)
45+
checker, err := attribute.NewBatchChecker(repo, commitID)
4646
if err != nil {
4747
return nil, err
4848
}
49-
defer deferable()
49+
defer checker.Close()
5050

5151
// sizes contains the current calculated size of all files by language
5252
sizes := make(map[string]int64)

0 commit comments

Comments
 (0)