Skip to content

Commit 579a0a0

Browse files
committed
Revert "Add error if file could not be retrieved"
This reverts commit 3881828.
1 parent 4976d3e commit 579a0a0

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

routers/api/v1/repo/file.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,12 +1049,7 @@ func GetFiles(ctx *context.APIContext) {
10491049

10501050
filesResponse, err := files_service.GetContentsListFromTrees(ctx, ctx.Repo.Repository, ref, files)
10511051
if err != nil {
1052-
if err.Error() == "the combined size of the requested blobs exceeds the per-request limit set by the server administrator" {
1053-
ctx.APIError(http.StatusRequestEntityTooLarge, err.Error())
1054-
} else {
1055-
ctx.APIErrorNotFound("GetFiles")
1056-
}
1057-
return
1052+
ctx.APIError(http.StatusRequestEntityTooLarge, err.Error())
10581053
}
10591054

10601055
ctx.SetTotalCountHeader(int64(count))

services/repository/files/file.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ func GetContentsListFromTrees(ctx context.Context, repo *repo_model.Repository,
2222
files := []*api.ContentsResponse{}
2323
var size int64
2424
for _, file := range treeNames {
25-
fileContents, err := GetContents(ctx, repo, file, branch, false)
26-
if err != nil {
27-
return nil, err
28-
}
25+
fileContents, _ := GetContents(ctx, repo, file, branch, false) // ok if fails, then will be nil
2926
if *fileContents.Content != "" {
3027
size += fileContents.Size // if content isn't empty (e. g. due to the single blob being too large), add file size to response size
3128
}

0 commit comments

Comments
 (0)