Commit Graph

2313 Commits

Author SHA1 Message Date
Jakob Ackermann d78aa189ec [ssh] fix the config specification in the authorized_keys template (#8031) (#8193)
The gitea flags must appear in front of the gitea command. Otherwise
 they are ignored.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
(cherry picked from commit 89648746a5)
2019-09-16 09:41:30 +08:00
guillep2k b228d22736 Add reviewrs as participants (#8124) 2019-09-12 17:52:33 -04:00
David Svantesson b6b1560701 Abort syncrhonization from LDAP source if there is some error. (#7965)
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
(cherry picked from commit b2d23a138942179d62f9bffdb3df272e9300e35b)
2019-08-25 02:59:21 +02:00
Mura Li c491c22279 Fix pull creation with empty changes (#7920) (#7926)
* Logs the stderr of git-apply
* Add an integration test
* Skip testPatch when patch is empty
2019-08-20 22:14:09 -04:00
Lunny Xiao 5649f0d2b3 fix wrong sender when send slack webhook (#7918) (#7924) 2019-08-20 13:42:14 -04:00
Antoine GIRARD 6b84a1d72b lfs/lock: round locked_at timestamp to second (#7872) (#7875)
* lfs/lock: round locked_at timestamp to second

* test returned locked_at values

* tests: use time RFC3339
2019-08-15 18:53:20 +08:00
Antoine GIRARD 89915ca8a0 Fix duplicate call of webhook (#7821) (#7824) 2019-08-12 09:53:26 +08:00
Antoine GIRARD 38e799779f api: fix multiple bugs with statuses endpoints (#7785) (#7807)
* fix commit statuses api url

* search refs before passing sha

* adjust tests

* directly search tags and branches names + remove un-needed check in NewCommitStatus

* fix comment

* de-duplicate code

* test: use relative setting.AppURL

* Update routers/api/v1/repo/status.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

* remove return

* Update routers/api/v1/repo/status.go

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-08-09 16:18:46 +03:00
WGH 4f39e56795 Fix Slack webhook fork message (#7774) (#7783)
The order of forkee and fork was mixed up.
2019-08-07 11:57:08 -04:00
Lunny Xiao 7b92f91e88
Fix approvals counting (#7757) (#7777)
* fix approvals counting

* fix tests

* fmt
2019-08-07 15:24:01 +08:00
Lunny Xiao aea49d0b92
fix rename failed when rewrite public keys (#7761) (#7769) 2019-08-06 15:41:26 +08:00
zeripath 1b5908fb6a Fix dropTableColumns sqlite implementation (#7710) (#7765)
* Fix dropTableColumns sqlite implementation

* use droptables and its index dropping support in v78 and v85

* golang-ci fixes

* Add migration from gitea 1.3.3 for sqlite which reveals the droptables bug - thus showing this works
2019-08-06 07:35:54 +03:00
Lunny Xiao c6f1825fe9 add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752) 2019-08-05 00:08:57 -04:00
guillep2k 4f5dbc4d00 Backport: fix repo_index_status lingering when deleting a repository (#7738) 2019-08-04 10:00:03 +03:00
Lauris BH 4ee8982e91 Fix milestone completness calculation when migrating (#7725) (#7732) 2019-08-04 09:29:17 +08:00
guillep2k 0d10482168 Fixes indexed repos keeping outdated indexes when files grow too large (#7731)
* Fixes indexed repos keeping outdated indexes when files grow too large

Co-Authored-By: zeripath <art27@cantab.net>
2019-08-03 21:42:53 +03:00
guillep2k 6d441de2bd Backport: skip non-regular files (e.g. submodules) on repo indexing (#7717)
* Backport: skip non-regular files (e.g. submodules) on repo indexing

* Include "executable" files in the index, as they are not necessarily binary
2019-08-02 22:40:15 +08:00
Lunny Xiao ee43d20d3b fix duplicated webhook when creating issue with assignees (#7681) (#7684) 2019-07-31 14:39:33 +03:00
David Svantesson 93bac4e10d Backport of #7675. (#7682)
Move add to hook queue for created repo to outside xorm session.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-07-31 11:19:14 +03:00
Lunny Xiao d827b0bfb7 change length of some repository's columns (#7652) (#7655) 2019-07-29 00:15:13 -04:00
renothing d789170e31 fix wrong email when use gitea as OAuth2 provider (#7640) (#7647)
when you use gitea as OAuth2 provider, the /api/v1/user should return
user primary email as identifier, which is unique in OAuth2 clients.

this patch use convert.ToUser replace all u.APIFormat in api requests,
return primary email when caller is yourself or admin.
2019-07-27 17:25:16 +03:00
Andreas Shimokawa 9bbe3eb0b4 reserve .well-known username (#7638) 2019-07-26 16:37:31 -04:00
Lunny Xiao 4c69e158e5 Fix bug create/edit wiki pages when code master branch protected (#7580) (#7623)
* fix bug create/edit wiki pages when code master branch protected

* improve FullPushingEnvironment function
2019-07-26 04:22:20 +03:00
zeripath b7e41f7b8f
Fix panic on push at #7611 (#7615) (#7618)
* Fix panic in #7611

Use pr.IssueID instead of pr.Issue.ID as Issue may not be loaded and is unnecessary

* Only fetch the head branch from the remote
2019-07-25 22:23:52 +01:00
Lunny Xiao 5ebf4990a5 Fix repository's pull request count error (#7518) (#7524)
* fix pr count error

* fix tests
2019-07-19 07:40:16 +01:00
mrsdizzie b45f9260bf Fix regex for issues in commit messages (#7444) (#7466)
* Fix regex for issues in commit messages

Use same regex as markup for matching in commits.

Fixes #7438

* make fmt
2019-07-14 21:05:59 +01:00
quantonganh 82d4d725ae only return head: null if source branch was deleted (#6705) (#7376)
* only return head: null if source branch was deleted

* add URL into GetPullRequest

* TestPullRequest_APIFormat

* log error if it is not Err(Branch)NotExist

(cherry picked from commit ff85a6331e)
2019-07-09 10:35:13 +08:00
Drew 89aa08d372 Fix mirror sync not automatically sending webhook requests (#7366) 2019-07-06 16:01:21 -04:00
Lunny Xiao 337d6915ff Detect migrating batch size (#7353)
* Make migrating batch size as configurable

* detect different table batch insert size and remove config item

* remove unrelated changes
2019-07-06 15:24:50 -04:00
Lunny Xiao e728b55812 Fix bug conflict between SyncReleasesWithTags and InsertReleases (#7337)
* fix bug conflict between SyncReleasesWithTags and InsertReleases

* fix tests

* fix fmt
2019-07-01 22:17:16 +01:00
zeripath 9fdd199cca make dropTableColumns drop columns on sqlite and constraints on all (#6849) 2019-07-01 15:26:59 -04:00
zeripath 3563650bdb #6946 Run hooks on merge/edit and cope with protected branches (#6961)
* Fix #6946 by checking PullRequest ID on pushing

* Ensure we have the owner name, the pr attributes and the the issue

* Fix TestSearchRepo by waiting till indexing is done

* Update integrations/repo_search_test.go

* changes as per @mrsdizzie

* missing comma

* Spelling mistake

* Fix full pushing environment
2019-07-01 09:18:13 +08:00
Lunny Xiao ff85dd3e12 Add commit statuses reports on pull request view (#6845)
* Add commit statuses reports on pull view

* Add some translations

* improve the UI

* fix fmt

* fix tests

* add a new test git repo to fix tests

* fix bug when headRepo or headBranch missing

* fix tests

* fix tests

* fix consistency

* fix tests

* fix tests

* change the test repo

* fix tests

* fix tests

* fix migration

* keep db size consistency

* fix translation

* change commit hash status table unique index

* remove unused table

* use char instead varchar

* make hashCommitStatusContext private

* split merge section with status check on pull view ui

* fix tests; fix arc-green theme on pull ui
2019-06-30 08:57:59 +01:00
Lunny Xiao 462284e2f5
Use batch insert on migrating repository to make the process faster (#7050)
* Use batch insert on migrating repository to make the process faster

* fix lint

* fix tests

* fix comments
2019-06-29 21:38:22 +08:00
Mario Lubenka 7c0f2b9843 Show Pull Request button or status of latest PR in branch list (#6990)
* Show Pull Request button or status of latest PR in branch list

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show pull request button on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show commit divergence on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Use XORMs Get instead of limit

* Links pull request ID and use smaller labels for displaying the pull request status

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Handle error when getting latest pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Indent template

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Check error when loading issue

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
2019-06-27 22:15:30 +08:00
silverwind da23041257 fix extra newlines when copying from diff in Firefox (#7288)
* fix extra newlines when copying from diff

See https://bugzilla.mozilla.org/show_bug.cgi?id=1273836

Basically, the <pre><code> seems to add a forced newline that is not
possible to get rid of via CSS, so I replaced it with just a <code>.

Secondly, .lines-type-marker also forced a newline in the copied text,
but that was possible to get rid of via user-select.

Safari still has a extraneous newline in the copied text of unknown
origin, but this should not block stop this PR.

* simplify .line-type-marker

* fix selector

* remove erronous ^^^

* Fix empty split diff

* Fix arc-theme-green

* fix add comment

* ensure line-num is copied too

* Update templates/repo/diff/box.tmpl

Co-Authored-By: zeripath <art27@cantab.net>

* attempt to fix safari via removing <code>

* remove useless whitespace at the end of 'class'

* remove inter-tag whitespace for code <td>s

* more inter-tag removal

* final inter-tag removal

* attempt to fix empty line copy

* move and comment getLineContent

* fix golint

* make background grey for missing added code
2019-06-26 22:35:07 +01:00
Lunny Xiao edc94c7041 Monitor all git commands; move blame to git package and replace git as a variable (#6864)
* monitor all git commands; move blame to git package and replace git as a variable

* use git command but not other commands

* fix build

* move exec.Command to git.NewCommand

* fix fmt

* remove unrelated changes

* remove unrelated changes

* refactor IsEmpty and add tests

* fix tests

* fix tests

* fix tests

* fix tests

* remove gitLogger

* fix fmt

* fix isEmpty

* fix lint

* fix tests
2019-06-26 14:15:26 -04:00
zeripath 5908bb1030
Make diff line-marker non-selectable (#7279)
* Make diff line-marker non-selectable
* Move to use data-* as per @mrsdizzie
* fix missing line nums
* Add a minimum-width to force right-align of the line num
* Move line-type-marker into separate column
2019-06-24 21:23:52 +01:00
Lunny Xiao aa7c34cf86 Fix error log when loading issues caused by a xorm bug (#7271)
* fix error log when loading issues caused by a xorm bug

* upgrade packages

* fix fmt

* fix Consistency

* fix tests
2019-06-23 18:22:43 +03:00
zeripath baefea311f
Fix #732: Add LFS objects to base repository on merging (#7082)
On merge we walk the merge history and ensure that all lfs objects pointed to in
the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)
2019-06-22 18:35:34 +01:00
Lunny Xiao d8168b356d
Add missing description of label on API (#7159)
* add missing description of label on API

* fix comment head

* fix swagger
2019-06-16 20:39:52 +08:00
Antoine GIRARD 367aeb169a Use go method to calculate ssh key fingerprint (#7128)
* Use go method to calculate key fingerprint

* add gitea copyright

* use native go method only for built-in server

* refactor and add tests

* add gitea copyright
2019-06-16 08:50:46 +01:00
zeripath cf2221e3ac Add LastLogin to the User API (#7196) 2019-06-15 23:28:32 -04:00
zeripath cde410521c
Only warn on errors in deleting LFS orphaned files during repo deletion (#7213) 2019-06-15 23:20:29 +01:00
Lunny Xiao 0323122fd7 fix duplicated file on pull request conflicted files (#7211) 2019-06-15 15:22:26 +01:00
zeripath 94ceaf1c0c Allow colon between fixing word and issue (#7207)
* Allow colon between fixing word and issue

* update test
2019-06-15 00:00:32 -04:00
John Olheiser 744fd6a1c8 Add error for fork already existing (#7185) 2019-06-12 16:20:43 -04:00
kolaente f9ec2f89f2 Add golangci (#6418) 2019-06-12 15:41:28 -04:00
Lunny Xiao 5832f8d90d Fix database lock when use random repository fallback image (#7166)
* fix database lock when use random repository fallback image

* remove unused function
2019-06-11 20:12:13 -04:00
Mario Lubenka 1608f63e39 Fixes diff on merged pull requests (#7171) 2019-06-11 19:32:08 -04:00