summaryrefslogtreecommitdiffstats
path: root/models/repo_indexer.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-12-06 23:18:04 -0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-12-07 15:18:04 +0800
commit5e4427e4e7178589b74a8b1a4d581eb8009d3cc8 (patch)
tree9c6267958ca6296eab3e89453629bda26de1e7e5 /models/repo_indexer.go
parent311c83ad17c718f1b81c94f84307b4288c90e374 (diff)
downloadgitea-5e4427e4e7178589b74a8b1a4d581eb8009d3cc8.tar.gz
gitea-5e4427e4e7178589b74a8b1a4d581eb8009d3cc8.zip
Fix repo indexer and submodule bug (#3107)
Diffstat (limited to 'models/repo_indexer.go')
-rw-r--r--models/repo_indexer.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/repo_indexer.go b/models/repo_indexer.go
index a6b049e081..4877d339f8 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 {