mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-09 13:52:32 +00:00
enhance(api): expose file mode in contents API response (#38713)
This commit is contained in:
@@ -79,6 +79,7 @@ func getExpectedFileResponseForCreate(info apiFileResponseInfo) *api.FileRespons
|
||||
LastAuthorDate: new(info.lastAuthorWhen),
|
||||
Size: 16,
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Encoding: &encoding,
|
||||
Content: &content,
|
||||
URL: &selfURL,
|
||||
|
||||
@@ -62,6 +62,7 @@ func getExpectedFileResponseForUpdate(info apiFileResponseInfo) *api.FileRespons
|
||||
LastCommitterDate: new(info.lastCommitterWhen),
|
||||
LastAuthorDate: new(info.lastAuthorWhen),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: 20,
|
||||
Encoding: &encoding,
|
||||
Content: &content,
|
||||
|
||||
@@ -38,6 +38,7 @@ func getExpectedContentsListResponseForContents(ref, refType, lastCommitSHA stri
|
||||
LastCommitterDate: new(time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400))),
|
||||
LastAuthorDate: new(time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400))),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: 30,
|
||||
URL: &selfURL,
|
||||
HTMLURL: &htmlURL,
|
||||
|
||||
@@ -37,6 +37,7 @@ func getExpectedContentsResponseForContents(inputRef string, expectedRef git.Ref
|
||||
LastCommitterDate: new(time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400))),
|
||||
LastAuthorDate: new(time.Date(2017, time.March, 19, 16, 47, 59, 0, time.FixedZone("", -14400))),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: 30,
|
||||
Encoding: new("base64"),
|
||||
Content: new("IyByZXBvMQoKRGVzY3JpcHRpb24gZm9yIHJlcG8x"),
|
||||
|
||||
@@ -109,6 +109,7 @@ func getExpectedFileResponseForRepoFilesCreate(commitID string, lastCommit *git.
|
||||
LastCommitterDate: new(lastCommit.Committer.When),
|
||||
LastAuthorDate: new(lastCommit.Author.When),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: 18,
|
||||
Encoding: &encoding,
|
||||
Content: &content,
|
||||
@@ -179,6 +180,7 @@ func getExpectedFileResponseForRepoFilesUpdate(commitID, filename, lastCommitSHA
|
||||
LastCommitterDate: new(lastCommitterWhen),
|
||||
LastAuthorDate: new(lastAuthorWhen),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: 43,
|
||||
Encoding: &encoding,
|
||||
Content: &content,
|
||||
@@ -283,6 +285,7 @@ func getExpectedFileResponseForRepoFilesUpdateRename(commitID, lastCommitSHA str
|
||||
SHA: detail.sha,
|
||||
LastCommitSHA: new(lastCommitSHA),
|
||||
Type: "file",
|
||||
Mode: "100644",
|
||||
Size: detail.size,
|
||||
Encoding: new("base64"),
|
||||
Content: &detail.content,
|
||||
|
||||
Reference in New Issue
Block a user