Ver Código Fonte

Don't cache files for now

We need the recursive listing for language detection, but we need the
"shorter"/top-level version for the index page.  For now we just don't
cache it.
Lucas Stadler 8 anos atrás
pai
commit
59a4e1b22e
1 arquivos alterados com 17 adições e 17 exclusões
  1. 17 17
      quit.go

+ 17 - 17
quit.go

@ -369,25 +369,25 @@ func (fc *FancyCommit) Description() string {
369 369
}
370 370
371 371
func (fc *FancyCommit) Files(recursive bool) ([]*FancyFile, error) {
372
	if fc.files == nil {
373
		tree, err := fc.commit.Tree()
374
		if err != nil {
375
			return nil, err
376
		}
372
	tree, err := fc.commit.Tree()
373
	if err != nil {
374
		return nil, err
375
	}
377 376
378
		recurse := 1
379
		if recursive {
380
			recurse = 0
381
		}
382
		err = tree.Walk(func(s string, entry *git.TreeEntry) int {
383
			fc.files = append(fc.files, NewFancyFile(fc.commit.Owner(), entry))
384
			return recurse
385
		})
386
		if err != nil {
387
			return nil, err
388
		}
377
	recurse := 1
378
	if recursive {
379
		recurse = 0
389 380
	}
390
	return fc.files, nil
381
	files := make([]*FancyFile, 0)
382
	err = tree.Walk(func(s string, entry *git.TreeEntry) int {
383
		files = append(files, NewFancyFile(fc.commit.Owner(), entry))
384
		return recurse
385
	})
386
	if err != nil {
387
		return nil, err
388
	}
389
390
	return files, nil
391 391
}
392 392
393 393
var readmeNames = []string{"README.md", "readme.md", "README.rst", "readme.rst", "README.txt", "readme.txt", "README"}