summaryrefslogtreecommitdiffstats
path: root/modules/repofiles/content.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repofiles/content.go')
-rw-r--r--modules/repofiles/content.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/repofiles/content.go b/modules/repofiles/content.go
index 9637658e78..d7d43ef9d1 100644
--- a/modules/repofiles/content.go
+++ b/modules/repofiles/content.go
@@ -38,6 +38,9 @@ func (ct *ContentType) String() string {
// GetContentsOrList gets the meta data of a file's contents (*ContentsResponse) if treePath not a tree
// directory, otherwise a listing of file contents ([]*ContentsResponse). Ref can be a branch, commit or tag
func GetContentsOrList(repo *models.Repository, treePath, ref string) (interface{}, error) {
+ if repo.IsEmpty {
+ return make([]interface{}, 0), nil
+ }
if ref == "" {
ref = repo.DefaultBranch
}