Skip to content

Commit 8435231

Browse files
ethantkoeniglunny
authored andcommitted
Fix repo indexer and submodule bug (#3107) (#3110)
* Fix repo indexer and submodule bug (#3107) * Empty commit to re-trigger CI
1 parent 237df2f commit 8435231

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

models/repo_indexer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ func populateRepoIndexer() error {
100100
}
101101
}
102102

103-
type updateBatch struct {
104-
updates []indexer.RepoIndexerUpdate
105-
}
106-
107103
func updateRepoIndexer(repo *Repository) error {
108104
changes, err := getRepoChanges(repo)
109105
if err != nil {
@@ -163,6 +159,10 @@ func addUpdate(filename string, repo *Repository, batch *indexer.Batch) error {
163159
return err
164160
} else if stat.Size() > setting.Indexer.MaxIndexerFileSize {
165161
return nil
162+
} else if stat.IsDir() {
163+
// file could actually be a directory, if it is the root of a submodule.
164+
// We do not index submodule contents, so don't do anything.
165+
return nil
166166
}
167167
fileContents, err := ioutil.ReadFile(filepath)
168168
if err != nil {

0 commit comments

Comments
 (0)