Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git-Trees API. #4185

Closed
wants to merge 450 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
450 commits
Select commit Hold shift + click to select a range
7c45a55
Fix incorrect caption of webhook setting (#4701) (#4717)
SagePtr Aug 15, 2018
48338e1
[skip ci] Updated translations via Crowdin
GiteaBot Aug 15, 2018
a59c455
Remove UsePrivilegeSeparation from the Docker sshd_config, see #2876 …
theasp Aug 15, 2018
bf6c63d
[skip ci] Updated translations via Crowdin
GiteaBot Aug 15, 2018
7b4bcc4
Fix failure on creating pull request with assignees (#4419) (#4583)
SagePtr Aug 16, 2018
99f0e54
[skip ci] Updated translations via Crowdin
GiteaBot Aug 16, 2018
ed04816
Add whitespace between chinese characters and english characters. (#4…
Aug 17, 2018
46905a3
Display error when adding a user to a team twice (#4746)
adelowo Aug 19, 2018
45a60f1
allow WIP marker to contains < or > (#4709)
JulienTant Aug 19, 2018
623d021
User shouldn't be able to approve or reject his/her own PR (#4729)
adelowo Aug 20, 2018
37c34e0
add letsencrypt to Gitea (#4189)
Aug 21, 2018
7a950a2
[skip ci] Updated translations via Crowdin
GiteaBot Aug 21, 2018
6598e98
Fixed bug where team with admin privelege type doesn't get any unit a…
adelowo Aug 21, 2018
f658384
Make sure to reset commit count in the cache on mirror syncing (#4720)
adelowo Aug 23, 2018
b92db71
[skip ci] Updated translations via Crowdin
GiteaBot Aug 23, 2018
59b1daa
Add myself to maintainers (#4777)
adelowo Aug 23, 2018
5b9c8fe
[skip ci] Updated translations via Crowdin
GiteaBot Aug 23, 2018
d5ed153
MySQL TLS (#4642)
aunger Aug 23, 2018
897b865
API /admin/users/{username} missing parameter (#4775)
Aug 23, 2018
eb7742b
Don't disclose emails of all users when sending out emails (#4664)
techknowlogick Aug 24, 2018
6814c26
Disable 'May Import Local Repository' when is disabled by setting (Is…
Aug 24, 2018
a26fd26
Update en-us and fr-fr versions of the "Upgrade from Gogs" doc (#4618)
deoren Aug 25, 2018
25c34d8
Fix missing release title in webhook (#4783) (#4796)
SagePtr Aug 26, 2018
5fe2746
Hide home button when landing page is not set to home (#4651)
0rzech Aug 27, 2018
1b821d2
Add Orzech to translator list (#4801)
0rzech Aug 27, 2018
c53e546
Locale for Edit and Remove due date issue (#4802)
webjoel Aug 27, 2018
5068374
Update legacy branch and tag URLs in dashboard to new format (#4812)
SagePtr Aug 28, 2018
8bb9520
[skip ci] Updated translations via Crowdin
GiteaBot Aug 28, 2018
0328acb
Upgrade images in .drone.yml to more recent versions (#4819)
techknowlogick Aug 29, 2018
f74cad1
[skip ci] Updated translations via Crowdin
GiteaBot Aug 29, 2018
7cc0d40
update image used for build-without-gcc step (#4818)
techknowlogick Aug 29, 2018
9eb63b0
Make reverse proxy auth optional (#4643)
Aug 29, 2018
e85daf1
Minor fix to TRANSLATORS (#4836)
SagePtr Aug 31, 2018
1b5ec15
[skip ci] Updated translations via Crowdin
GiteaBot Aug 31, 2018
48928cc
Add missing History link to directory listings (#4829)
decke Sep 3, 2018
af5435f
[skip ci] Updated translations via Crowdin
GiteaBot Sep 3, 2018
59fdb8c
Backport 1.5.1 changelog (#4854)
techknowlogick Sep 3, 2018
9905e9a
issues api allow pulls and fix #4832 (#4852)
lunny Sep 3, 2018
0b05cd0
Fix trimming of markup section names (#4863)
Eisfunke Sep 4, 2018
d38aeda
update comparsion docs to add file viewer items (#4865)
lunny Sep 5, 2018
72429b3
Punctuation changes in documentation (#4866)
maiki Sep 5, 2018
ec90e15
Remove feature `global code search` from GitLab CE (#4875)
codescale Sep 5, 2018
fca09a5
docs(comparison): correct GitLab CE multiple assignees for issues (#4…
max-wittig Sep 7, 2018
4318e91
Do not autocreate directory for new user/orgs (#4828) (#4849)
SagePtr Sep 7, 2018
ebcb8bc
offline use of fonts (#4872)
techknowlogick Sep 7, 2018
df943b2
Fix redirect with non-ascii branch names (#4764) (#4810)
SagePtr Sep 7, 2018
4ed80ae
Add push webhook support for mirrored repositories (#4127)
lafriks Sep 7, 2018
60b4e64
Improve dependency UI (#4503)
lafriks Sep 7, 2018
0c402a8
Extract header and footer content to separate tmpl (#4797)
lukasbestle Sep 7, 2018
7ef246f
Add sudo functionality to the API (#4809)
zeripath Sep 7, 2018
b6c878d
Fixes repo branch endpoint summary (#4893)
Lewiscowles1986 Sep 9, 2018
f152851
[skip ci] Updated translations via Crowdin
GiteaBot Sep 9, 2018
691eb27
Move README_ZH.md Screenshots to Bottom (#4895)
vcaesar Sep 9, 2018
112ef3c
fix: Crippled diff (#4726) (#4900)
tonivj5 Sep 9, 2018
0304456
[skip ci] Updated translations via Crowdin
GiteaBot Sep 9, 2018
2fe11b7
Slack webhook channel name cannot be empty or just contain an hashtag…
adelowo Sep 10, 2018
6ac2094
[skip ci] Updated translations via Crowdin
GiteaBot Sep 10, 2018
b413dd7
allow api to create tags for releases (#4890)
Bobonium Sep 10, 2018
72accef
Enforce token on api routes [fixed critical security issue #4357] (#4…
beeonthego Sep 10, 2018
667f119
Add file name and branch to page title (#4902)
adelowo Sep 10, 2018
42a2aad
Remove traces of embedded TiDB (#4906)
techknowlogick Sep 11, 2018
740e3d6
[skip ci] Updated translations via Crowdin
GiteaBot Sep 11, 2018
5c7eeb7
Remove zookeeper documentation (#4910)
Sep 11, 2018
549934b
[skip ci] Updated translations via Crowdin
GiteaBot Sep 11, 2018
f0ede64
Fix: Let's Encrypt configuration settings (#4911)
drewbowering Sep 12, 2018
adc13ad
Add/remove/list oauth providers via cli (#4591)
techknowlogick Sep 12, 2018
8910c49
[skip ci] Updated translations via Crowdin
GiteaBot Sep 12, 2018
de08694
feat(repo): support search repository by topic name (#4505)
appleboy Sep 13, 2018
fcf365e
Fix bug when repo remained bare if multiple branches pushed (#4923)
SagePtr Sep 13, 2018
55e7e1d
Force user to change password (#4489)
adelowo Sep 13, 2018
a64c719
fix bug forget to remove Stopwatch when remove repository (#4928)
linweijie2012 Sep 13, 2018
d0f5292
Allow admin toggle forcing a password change for newly created users …
adelowo Sep 13, 2018
15064a3
doc: add Cloudron package (#4937)
gramakri Sep 15, 2018
d7c2fa9
[skip ci] Updated translations via Crowdin
GiteaBot Sep 15, 2018
5e2a1d4
fix(topics): don't redirect to expole page. (#4938)
appleboy Sep 15, 2018
3a05893
make sure to catch the right error so it is displayed as an error on …
adelowo Sep 16, 2018
afe0379
Fix some issues with special chars in branch names (#3767)
nubenum Sep 16, 2018
d847a98
Code review UI improvements and bugfixes (#4682)
lafriks Sep 17, 2018
caf33a0
fix url in discord webhook (#4953)
esno Sep 18, 2018
66f33b6
[skip ci] Updated translations via Crowdin
GiteaBot Sep 18, 2018
228826d
Fix interpunction in English translation. (#4958)
bugreport0 Sep 19, 2018
64d8e7a
[skip ci] Updated translations via Crowdin
GiteaBot Sep 19, 2018
58491da
Fix null pointer dereference in ParseCommitWithSignature (#4962)
SagePtr Sep 20, 2018
82d441b
[skip ci] Updated translations via Crowdin
GiteaBot Sep 20, 2018
3e7e7f4
Fix #4877 to follow the OpenID Connect Audiences spec (#4878)
OvermindDL1 Sep 20, 2018
f055495
ADD: Hint to function of docker version tags (#4967)
Wyall Sep 21, 2018
8e9d23d
Update Swagger API to match the return of /users/search (#4847)
zeripath Sep 21, 2018
dd4314b
Fix preview when adding new code review comment (#4975)
lafriks Sep 25, 2018
974b34a
[skip ci] Updated translations via Crowdin
GiteaBot Sep 25, 2018
1e59f29
Adjust maintainers (#4979)
Sep 27, 2018
46e07e3
[skip ci] Updated translations via Crowdin
GiteaBot Sep 27, 2018
ef96951
Fix user menu item styling (#4985)
silverwind Sep 27, 2018
9d177bb
make sure milestone listing is consistent across board (#4987)
adelowo Sep 28, 2018
29a20d9
Fix layout of the topics editing form (#4971)
kzmi Sep 29, 2018
b90c97a
Detect charset and convert non UTF-8 files for display (#4950)
lafriks Sep 29, 2018
981c638
Fix #rrggbbaa color to rgba for better browser compatibility (#4990)
SagePtr Sep 29, 2018
bb0a40d
Disable debug routes unless PPROF is enabled in configuration (#4995)
lafriks Sep 29, 2018
350aa83
[skip ci] Updated translations via Crowdin
GiteaBot Sep 29, 2018
8d0d9b6
Upgrade gopkg.in/testfixtures.v2 (#4999)
typeless Oct 2, 2018
63f15cc
[skip ci] Updated translations via Crowdin
GiteaBot Oct 2, 2018
0004af3
README: update make command to build full release (#5004)
Oct 3, 2018
d587f36
Add missing envionment vars for DB with Docker (#5007)
Xiol Oct 3, 2018
b47751a
Fix a typo in app.ini.sample (#5015)
Oct 5, 2018
e46a55f
Hide outdated comments in file view (#5017)
jonasfranz Oct 5, 2018
dcfb0bd
Fix missing AppSubUrl in some templates (#5020)
SagePtr Oct 5, 2018
13b4eaf
Fix missing AppSubUrl in few more templates (#5021)
SagePtr Oct 5, 2018
f5869a4
Remove links from topics in edit mode (#5026)
SagePtr Oct 6, 2018
1542444
Fix adding review comment in split view (#5038)
lafriks Oct 9, 2018
50cfaa6
Backport 1.5.2 changelog (#5053)
techknowlogick Oct 9, 2018
3f4c472
Add HOWTO for releasing Gitea (#5054)
techknowlogick Oct 9, 2018
f8b14f2
Fixed spelling typos in CONTRIBUTING.md (#5061)
SagePtr Oct 10, 2018
d22f137
Fix golint to new URL (#5079)
lafriks Oct 12, 2018
e925f52
Fix dep for actual goth version used in dep lock file (#5078)
lafriks Oct 12, 2018
194ed38
fix release creation via API (#5076)
lunny Oct 15, 2018
6e8b8e0
CN translation of README (#5050)
BetaCat0 Oct 15, 2018
6e81f3d
Update process to include tag vX.Y.0-dev on master branch (#5091)
lafriks Oct 16, 2018
59849af
ZH-CN translation of Advanced part (#5090)
BetaCat0 Oct 17, 2018
bb267f2
[skip ci] Updated translations via Crowdin
GiteaBot Oct 17, 2018
eb826f1
Add change log for 1.6.0-rc1 (#5095)
lunny Oct 17, 2018
a8182a3
[skip ci] Updated translations via Crowdin
GiteaBot Oct 17, 2018
83f7843
ZH-CN translation of Usage part (#5086)
BetaCat0 Oct 17, 2018
0cc3320
add myself to maintainers (#5098)
kolaente Oct 17, 2018
88e62d7
[skip ci] Updated translations via Crowdin
GiteaBot Oct 18, 2018
5eecb9a
CN translation of README (#5049)
BetaCat0 Oct 18, 2018
9a8897f
Fix regex to support optional end line of old section in diff hunk (#…
kolaente Oct 18, 2018
41fc619
feat(topic): search keyword by splitting provided values by , (#4939)
appleboy Oct 18, 2018
ccd33cf
Add myself to maintainers (#5101)
BetaCat0 Oct 18, 2018
aa2d183
Use fingerprint in place of id (#5099)
sapk Oct 18, 2018
fc8e16d
refactor: err != nil check, just return error instead (#5093)
appleboy Oct 18, 2018
d9e8366
ZH-CN translation of Installation part (#5089)
BetaCat0 Oct 18, 2018
0f82261
Use native go method to get current user rather than environment vari…
SagePtr Oct 18, 2018
e9dfce0
Use APP_NAME on home page (#5048)
mcnesium Oct 18, 2018
b5797da
Add support for search by uid (#4876)
zeripath Oct 18, 2018
f596178
Add notification interface and refactor UI notifications (#5085)
lunny Oct 18, 2018
b8529e2
Fix home page template regression (#5102)
darktohka Oct 18, 2018
afc156a
Make switch more clear (#5119)
cristaloleg Oct 19, 2018
ff4d1ce
[skip ci] Updated translations via Crowdin
GiteaBot Oct 19, 2018
381d561
Fix deadlock when sqlite (#5118)
lunny Oct 19, 2018
d28ab73
Remove duplicated if bodies (#5121)
cristaloleg Oct 19, 2018
3aa4da0
Use type switch (#5122)
cristaloleg Oct 19, 2018
d1ef32a
Use named const instead of a raw string (#5115)
cristaloleg Oct 20, 2018
7ff1d1d
Give user a link to create PR after push (#4716)
JulienTant Oct 20, 2018
8b1276c
Add LFS timeout issue to troubleshooting doc (#5129)
ravenscroftj Oct 20, 2018
bf52578
fix fading menu in arc-green theme (#5128)
glaszig Oct 20, 2018
2ae67fb
Retry test-fixtures loading in case of transaction rollback (#5125)
typeless Oct 20, 2018
1a59c90
Remove check for negative length (#5120)
cristaloleg Oct 20, 2018
692c9ae
Add must-change-password flag to cli for creating a user (#4955)
adelowo Oct 20, 2018
9fb741b
Fix SQL quoting (#5117)
filipnavara Oct 20, 2018
1f72e70
Fix Swagger JSON autogeneration issues. (#4845)
zeripath Oct 21, 2018
4335971
Increase the retry limit to 20 times and the interval to 200ms (#5134)
typeless Oct 21, 2018
919b06d
Add comment replies (#5104)
jonasfranz Oct 22, 2018
8f39249
User action heatmap (#5131)
kolaente Oct 23, 2018
121cd6c
Update vendor/go-sqlite3 (#5133)
typeless Oct 23, 2018
35f7eb4
Update build tags for sqlite_unlock_notify (#5144)
typeless Oct 23, 2018
1cef59e
Update outdated Go toolchain version for .drone.yml (#5146)
typeless Oct 23, 2018
5776bb4
Update the docs for sqlite_unlock_notify (#5145)
typeless Oct 23, 2018
2743b29
Update vendor/github.com/mattn/go-sqlite3 (#5162)
typeless Oct 24, 2018
7aa43ea
Fix JSON result of empty array (#5154)
sapk Oct 24, 2018
5cf2e9f
[skip ci] Updated translations via Crowdin
GiteaBot Oct 24, 2018
fd39667
Set heatmap color range configurable (#5165)
sapk Oct 24, 2018
d05774a
revert #5146 (#5167)
sapk Oct 25, 2018
da617fc
[skip ci] Updated translations via Crowdin
GiteaBot Oct 25, 2018
8fc2f72
Disable sqlite test (#5178)
typeless Oct 25, 2018
e53276c
Fix sqlite lock (#5176)
lunny Oct 25, 2018
87e7522
Update go-macaron/session to latest mast to fix RCE-bug (#5177)
bkcsoft Oct 25, 2018
cf56d46
Fix race on updatesize (#5190)
lunny Oct 26, 2018
257890c
[skip ci] Updated translations via Crowdin
GiteaBot Oct 26, 2018
012ea4a
Update TRANSLATORS (#5194)
briolantonio Oct 26, 2018
7633d03
Update x/net (#5169)
sapk Oct 26, 2018
60aa671
Update vendor/golang.org/x/sys (#5059)
tuxillo Oct 26, 2018
9249c13
fix sqlite lock (#5184)
lunny Oct 27, 2018
068217c
Update with-docker.en-us.md (#5203)
pestrickland Oct 28, 2018
fadb78c
Fix to 3819 - Filtering issues by tags on main screen issues (#3824)
rvillablanca Oct 28, 2018
13dc611
fix: Add secret to all webhook's payload where it has been missing (#…
HoffmannP Oct 28, 2018
24434b5
fix showing pull request link when delete a branch (#5166)
lunny Oct 28, 2018
80da260
UX of link account (Step 1) (#5006)
Oct 28, 2018
f69d36b
k8s deployment (#5046)
BetaCat0 Oct 29, 2018
2542b66
[skip ci] Updated translations via Crowdin
GiteaBot Oct 29, 2018
f7ce2b8
Kill testing processes if the test takes too long (#5174)
typeless Oct 29, 2018
0e29981
fix sqlite and mssql lock (#5214)
lunny Oct 29, 2018
5b49d45
[skip ci] Updated translations via Crowdin
GiteaBot Oct 29, 2018
83fcc6f
Fix emojis not showing in commit messages (#5168)
jamesa Oct 29, 2018
af6ac62
fix sqlite lock (#5210)
lunny Oct 30, 2018
966f02f
Serve audio files using HTML5 audio tag (#5221)
cez81 Oct 30, 2018
56c8314
[skip ci] Updated translations via Crowdin
GiteaBot Oct 30, 2018
c93f12c
Make gitea serv use api/internal (#4886)
sapk Oct 30, 2018
43acff4
[skip ci] Updated translations via Crowdin
GiteaBot Oct 30, 2018
40015e7
remove unused db init on commands serv, update, hooks (#5225)
lunny Oct 30, 2018
cc2fd48
fix data race on migrate repository (#5224)
lunny Oct 30, 2018
5a6daf7
Pass link prefixes to external markup parsers (#5201)
Eisfunke Oct 30, 2018
5fadd11
Add AutoHead functionality. (#5186)
zeripath Oct 30, 2018
46da812
[skip ci] Updated translations via Crowdin
GiteaBot Oct 30, 2018
92030cd
only chown directories during docker setup if necessary. Fix #4425 (#…
fabian-braun Oct 30, 2018
c012fd5
Generate random password (#5023)
adelowo Oct 30, 2018
51623fc
This commit will reduce join star, repo_topic, topic tables on repo s…
lunny Oct 30, 2018
2ab56e1
Fix markdown image with link (#4675)
LER0ever Oct 30, 2018
6cd41ec
Fix issue where ecdsa and other key types are not synced from LDAP (#…
xor-gate Oct 31, 2018
b9bff47
Add changelog for 1.5.3 release (#5227)
lafriks Oct 31, 2018
72e7986
Add command for migrating database (#4954)
rstefan1 Oct 31, 2018
60de076
fix compatibility heatmap with mysql 8 (#5232)
Oct 31, 2018
5ae50c6
[skip ci] Updated translations via Crowdin
GiteaBot Oct 31, 2018
e75fe1b
Update API link in README (#5241)
cez81 Nov 1, 2018
3a408b8
fix: Accept web-command cli flags if web-command is commited (#5200)
HoffmannP Nov 1, 2018
215b63b
Keys API changes (#4960)
zeripath Nov 1, 2018
3a6972c
Create AuthorizedKeysCommand (#5236)
zeripath Nov 1, 2018
9cd224c
[skip ci] Updated translations via Crowdin
GiteaBot Nov 1, 2018
bacbc57
Update golang version in Dockerfile (#5246)
Nov 1, 2018
b3a7c2c
Fixed heatmap not working in mssql (#5248)
kolaente Nov 1, 2018
1be1627
Fixed wrong api request url for instances running in subfolders (#5247)
kolaente Nov 3, 2018
023d812
Update gitignore list (#5258)
sapk Nov 3, 2018
b7983c7
Fix #5226 by adding CSRF checking to api reqToken and add CSRF to the…
zeripath Nov 4, 2018
8bb93c6
Add zeripath to maintainers (#5273)
zeripath Nov 4, 2018
eafcf90
1.6.0-rc2 changelog (#5276)
techknowlogick Nov 5, 2018
edf9411
Clean up docs (#5274)
techknowlogick Nov 5, 2018
e0d57fa
Prometheus endpoint (#5256)
Nov 5, 2018
6054ac8
Remove maxlines option for file logger (#5282)
lafriks Nov 7, 2018
7359948
[skip ci] Updated translations via Crowdin
GiteaBot Nov 7, 2018
41d70dc
Fix typo in configuration (#5295)
pluehne Nov 8, 2018
df9b85b
Fix U2F if gitea is configured in subpath (#5302)
lafriks Nov 8, 2018
4f21e0b
Add option to disable automatic mirror syncing. (#5242)
cez81 Nov 8, 2018
3197f73
fix bug when users have serval teams with different units on differen…
lunny Nov 9, 2018
25edcd9
[skip ci] Updated translations via Crowdin
GiteaBot Nov 9, 2018
9c51b78
Fix file edit change preview functionality (#5300)
lafriks Nov 9, 2018
0eac73a
[skip ci] Updated translations via Crowdin
GiteaBot Nov 9, 2018
b5c770f
Fix create team, update team missing units (#5188)
lunny Nov 10, 2018
0bd5f6f
Remove x/net/context vendor by using std package (#5202)
sapk Nov 10, 2018
dd76689
Block registration based on email domain (#5157)
adelowo Nov 15, 2018
dc076df
[skip ci] Updated translations via Crowdin
GiteaBot Nov 15, 2018
7906976
Implement pasting image from clipboard for browsers that supports tha…
lafriks Nov 15, 2018
74f03d3
added the ability to set labels on the "edit pull request" api (#5347)
lucienkerl Nov 16, 2018
89a1eb2
[skip ci] Updated translations via Crowdin
GiteaBot Nov 16, 2018
cb37bc1
Set ACL on uploads (#5344)
techknowlogick Nov 16, 2018
5de1348
Migration fixes for gogs (0.11.66) to gitea (1.6.0) #5318 (#5341)
nougad Nov 18, 2018
fd9ea48
[skip ci] Updated translations via Crowdin
GiteaBot Nov 18, 2018
154faf7
Add raw blob endpoint to get objects by SHA ID (#5334)
HoffmannP Nov 18, 2018
a74bb76
app.ini.sample: add ENABLE_USER_HEATMAP default config (#5362)
sapk Nov 20, 2018
15e42cf
dont' send assign webhooks when creating issue (#5365)
lunny Nov 20, 2018
5563133
add api for user to create org (#5268)
lunny Nov 20, 2018
d805745
support envs on external render commands (#5278)
lunny Nov 20, 2018
3af4c56
Show review summary in pull requests (#5132)
kolaente Nov 22, 2018
96e797e
Backport 1.6.0 changelog to master (#5384)
techknowlogick Nov 23, 2018
092efad
[skip ci] Updated translations via Crowdin
GiteaBot Nov 23, 2018
95a419b
[website] file rendering through external binaries (#5387)
juanpablo-santos Nov 23, 2018
99fa5ee
API: '/orgs/:org/repos': return private repos with read access (#5310…
inxonic Nov 23, 2018
a04069d
Don't force a password change for the admin user when creating an acc…
adelowo Nov 25, 2018
a7b3e41
Fix typos in configuration (#5398)
pluehne Nov 25, 2018
8c7ad40
Fix dependent issue searching when gitea is run in subpath (#5392)
lafriks Nov 25, 2018
af99357
Notes on upgrading docker installation (#5395)
ryanhalliday Nov 26, 2018
5355736
changed route from /trees to /git/trees. added additional comments.
Kasi-R Nov 26, 2018
2a959b4
Merge branch 'master' of https://github.com/Kasi-R/gitea
Kasi-R Nov 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,16 @@ func RegisterRoutes(m *macaron.Macaron) {
// Repositories
m.Post("/org/:org/repos", reqToken(), bind(api.CreateRepoOption{}), repo.CreateOrgRepo)

m.Group("/repos", func() {
m.Get("/search", repo.Search)
})

m.Combo("/repositories/:id", reqToken()).Get(repo.GetByID)

m.Group("/repos", func() {
m.Get("/search", repo.Search)
m.Post("/migrate", reqToken(), bind(auth.MigrateRepoForm{}), repo.Migrate)

m.Group("/:username/:reponame", func() {
m.Combo("").Get(repo.Get).Delete(reqToken(), repo.Delete)
m.Group("/trees", func() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably use github compatible route (/git/trees)

m.Combo("/:sha", context.RepoRef()).Get(repo.GetTree)
})
m.Group("/hooks", func() {
m.Combo("").Get(repo.ListHooks).
Post(bind(api.CreateHookOption{}), repo.CreateHook)
Expand Down
84 changes: 84 additions & 0 deletions routers/api/v1/repo/tree.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package repo

import (
"fmt"
"strings"

"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/git"
"code.gitea.io/sdk/gitea"
)

func GetTree(ctx *context.APIContext) {
sha := ctx.Params("sha")
if len(sha) == 0 {
ctx.Error(400, "sha not provided", nil)
return
}
Tree := GetTreeBySHA(ctx, sha)
if Tree != nil {
ctx.JSON(200, Tree)
} else {
ctx.Error(400, "sha invalid", nil)
}
}

func GetTreeBySHA(ctx *context.APIContext, sha string) *gitea.GitTreeResponse {
GitTree, err := ctx.Repo.GitRepo.GetTree(sha)
if err != nil || GitTree == nil{
return nil
}
tree := new(gitea.GitTreeResponse)
RepoID := strings.TrimRight(setting.AppURL, "/") + "/api/v1/repos/" + ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name
tree.SHA = GitTree.ID.String()
tree.URL = RepoID + "/trees/" + tree.SHA
var Entries git.Entries
if ctx.QueryBool("recursive") {
Entries, err = GitTree.ListEntriesRecursive()
} else {
Entries, err = GitTree.ListEntries()
}
if err != nil {
return tree
}
RepoIDLen := len(RepoID)
BlobURL := make([]byte, RepoIDLen + 47)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kasi-R could you please add a comment or variable describing where the magic number 47 comes from?

copy(BlobURL[:], RepoID)
copy(BlobURL[RepoIDLen:], "/blobs/")
TreeURL := make([]byte, RepoIDLen + 47)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above -- same here please.

copy(TreeURL[:], RepoID)
copy(TreeURL[RepoIDLen:], "/trees/")
CopyPos := len(TreeURL) - 40
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar request here -- where is the 40 coming from?


if len(Entries) > 1000 {
tree.Entries = make([]gitea.GitTreeEntry, 1000)
} else {
tree.Entries = make([]gitea.GitTreeEntry, len(Entries))
}
for e := range Entries {
if e > 1000 {
tree.Truncated = true
break
}

tree.Entries[e].Path = Entries[e].Name()
tree.Entries[e].Mode = fmt.Sprintf("%06x", Entries[e].Mode())
tree.Entries[e].Type = string(Entries[e].Type)
tree.Entries[e].Size = Entries[e].Size()
tree.Entries[e].SHA = Entries[e].ID.String()

if Entries[e].IsDir() {
copy(TreeURL[CopyPos:], Entries[e].ID.String())
tree.Entries[e].URL = string(TreeURL[:])
} else {
copy(BlobURL[CopyPos:], Entries[e].ID.String())
tree.Entries[e].URL = string(BlobURL[:])
}
}
return tree
}