diff options
Diffstat (limited to 'modules/indexer/code/git.go')
-rw-r--r-- | modules/indexer/code/git.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/indexer/code/git.go b/modules/indexer/code/git.go index 919d785406..b76f6d6778 100644 --- a/modules/indexer/code/git.go +++ b/modules/indexer/code/git.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "code.gitea.io/gitea/models" + repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -27,7 +27,7 @@ type repoChanges struct { RemovedFilenames []string } -func getDefaultBranchSha(repo *models.Repository) (string, error) { +func getDefaultBranchSha(repo *repo_model.Repository) (string, error) { stdout, err := git.NewCommand("show-ref", "-s", git.BranchPrefix+repo.DefaultBranch).RunInDir(repo.RepoPath()) if err != nil { return "", err @@ -36,8 +36,8 @@ func getDefaultBranchSha(repo *models.Repository) (string, error) { } // getRepoChanges returns changes to repo since last indexer update -func getRepoChanges(repo *models.Repository, revision string) (*repoChanges, error) { - status, err := repo.GetIndexerStatus(models.RepoIndexerTypeCode) +func getRepoChanges(repo *repo_model.Repository, revision string) (*repoChanges, error) { + status, err := repo_model.GetIndexerStatus(repo, repo_model.RepoIndexerTypeCode) if err != nil { return nil, err } @@ -89,7 +89,7 @@ func parseGitLsTreeOutput(stdout []byte) ([]fileUpdate, error) { } // genesisChanges get changes to add repo to the indexer for the first time -func genesisChanges(repo *models.Repository, revision string) (*repoChanges, error) { +func genesisChanges(repo *repo_model.Repository, revision string) (*repoChanges, error) { var changes repoChanges stdout, err := git.NewCommand("ls-tree", "--full-tree", "-l", "-r", revision). RunInDirBytes(repo.RepoPath()) @@ -101,7 +101,7 @@ func genesisChanges(repo *models.Repository, revision string) (*repoChanges, err } // nonGenesisChanges get changes since the previous indexer update -func nonGenesisChanges(repo *models.Repository, revision string) (*repoChanges, error) { +func nonGenesisChanges(repo *repo_model.Repository, revision string) (*repoChanges, error) { diffCmd := git.NewCommand("diff", "--name-status", repo.CodeIndexerStatus.CommitSha, revision) stdout, err := diffCmd.RunInDir(repo.RepoPath()) |