From 84352316a94907f0f376f0f73e6d906e7005aea9 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 7 Dec 2017 22:52:18 -0800 Subject: [PATCH] Fix repo indexer and submodule bug (#3107) (#3110) * Fix repo indexer and submodule bug (#3107) * Empty commit to re-trigger CI --- models/repo_indexer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/repo_indexer.go b/models/repo_indexer.go index a6b049e08..4877d339f 100644 --- a/models/repo_indexer.go +++ b/models/repo_indexer.go @@ -100,10 +100,6 @@ func populateRepoIndexer() error { } } -type updateBatch struct { - updates []indexer.RepoIndexerUpdate -} - func updateRepoIndexer(repo *Repository) error { changes, err := getRepoChanges(repo) if err != nil { @@ -163,6 +159,10 @@ func addUpdate(filename string, repo *Repository, batch *indexer.Batch) error { return err } else if stat.Size() > setting.Indexer.MaxIndexerFileSize { return nil + } else if stat.IsDir() { + // file could actually be a directory, if it is the root of a submodule. + // We do not index submodule contents, so don't do anything. + return nil } fileContents, err := ioutil.ReadFile(filepath) if err != nil {