summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Use gitea forked macaron (#7933)Tamal Saha2019-08-2334-39/+44
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Change repo search to use exact match for topic search. (#7941)David Svantesson2019-08-221-1/+5
| | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* don't convert buffer to string (#7115)Lunny Xiao2019-08-221-1/+1
|
* Add file status on API (#7671)Lunny Xiao2019-08-212-30/+70
| | | | | | | | | | * add file status on API * fix tests * fix tests * fix tests
* Fix pull creation with empty changes (#7920)Mura Li2019-08-201-7/+10
| | | | | * Logs the stderr of git-apply * Add an integration test * Skip testPatch when patch is empty
* fix wrong sender when send slack webhook (#7918)Lunny Xiao2019-08-201-4/+4
|
* Extract the username and password from the mirror url (#7651)zeripath2019-08-161-1/+37
| | | | | | | | | | | | * Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-1546-251/+257
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-152-5/+7
| | | | | | | | | | | | | | * Convert files to utf-8 for indexing * Move utf8 functions to modules/base * Bump repoIndexerLatestVersion to 3 * Add tests for base/encoding.go * Changes to pass gosimple * Move UTF8 funcs into new modules/charset package
* lfs/lock: round locked_at timestamp to second (#7872)Antoine GIRARD2019-08-151-1/+1
| | | | | | | | * lfs/lock: round locked_at timestamp to second * test returned locked_at values * tests: use time RFC3339
* move CreateReview to moduels/pull (#7841)Lunny Xiao2019-08-141-37/+0
|
* Check commit message hashes before making links (#7713)Gary Kim2019-08-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check commit message hashes before making links Previously, when formatting commit messages, anything that looked like SHA1 hashes was turned into a link using regex. This meant that certain phrases or numbers such as `777777` or `deadbeef` could be recognized as a commit even if the repository has no commit with those hashes. This change will make it so that anything that looks like a SHA1 hash using regex will then also be checked to ensure that there is a commit in the repository with that hash before making a link. Signed-off-by: Gary Kim <gary@garykim.dev> * Use gogit to check if commit exists This commit modifies the commit hash check in the render for commit messages to use gogit for better performance. Signed-off-by: Gary Kim <gary@garykim.dev> * Make code cleaner Signed-off-by: Gary Kim <gary@garykim.dev> * Use rev-parse to check if commit exists Signed-off-by: Gary Kim <gary@garykim.dev> * Add and modify tests for checking hashes in html link rendering Signed-off-by: Gary Kim <gary@garykim.dev> * Return error in sha1CurrentPatternProcessor Co-Authored-By: mrsdizzie <info@mrsdizzie.com> * Import Gitea log module Signed-off-by: Gary Kim <gary@garykim.dev> * Revert "Return error in sha1CurrentPatternProcessor" This reverts commit 28f561cac46ef7e51aa26aefcbe9aca4671366a6. Signed-off-by: Gary Kim <gary@garykim.dev> * Add debug logging to sha1CurrentPatternProcessor This will log errors by the git command run in sha1CurrentPatternProcessor if the error is one that was unexpected. Signed-off-by: Gary Kim <gary@garykim.dev>
* Fix duplicate call of webhook (#7821)Antoine GIRARD2019-08-111-1/+0
|
* api: fix multiple bugs with statuses endpoints (#7785)Antoine GIRARD2019-08-092-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix approvals counting (#7757)Lunny Xiao2019-08-072-6/+9
| | | | | | | | * fix approvals counting * fix tests * fmt
* Fix Slack webhook fork message (#7774)WGH2019-08-061-2/+2
| | | The order of forkee and fork was mixed up.
* Add migration step to remove old repo_indexer_status orphaned records (#7746)guillep2k2019-08-062-0/+18
| | | | | | | | | | | | * Add migration step to remove old repo_indexer_status orphaned records * Include RepoIndexerStatus struct definition in the migrate function * Change .Delete(o) into ID(o.ID).Delete(new(RepoIndexerStatus)) * Simplification of the delete procedure * Rename v91.go to v92.go
* fix rename failed when rewrite public keys (#7761)Lunny Xiao2019-08-061-1/+3
|
* Fix dropTableColumns sqlite implementation (#7710)zeripath2019-08-053-97/+23
| | | | | | | | | | * 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
* Add SQL execution on log and indexes on table repository and comment (#7740)Lunny Xiao2019-08-055-6/+36
| | | | | | | | * add index on comment * add SQL execution time on log and index owner_id on repository * add migration
* add pagination for admin api get orgs and fix only list public orgs bug (#7742)Lunny Xiao2019-08-041-3/+1
|
* Fix repo_index_status lingering when deleting a repository (#7734)guillep2k2019-08-041-0/+1
|
* Fix milestone completness calculation when migrating (#7725)Lauris BH2019-08-031-4/+16
|
* Fixes indexed repos keeping outdated indexes when files grow too large (#7712)guillep2k2019-08-031-1/+1
|
* org/members: display 2FA members states + optimize sql requests (#7621)Antoine GIRARD2019-08-0211-19/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * org/members: display 2FA state * fix comment typo * lay down UserList bases * add basic test for previous methods * add comment for UserList type * add valid two-fa account * test new UserList methods * optimize MembersIsPublic by side loading info on GetMembers + fix integrations tests * respect fmt rules * use map for data * Optimize GetTwoFaStatus * rewrite by using existing sub func * Optimize IsUserOrgOwner * remove un-used code * tests: cover empty org + fix import order * tests: add ErrTeamNotExist path * tests: fix wrong expected result
* Include "executable" files in the index, as they are not necessarily binary ↵guillep2k2019-08-021-1/+1
| | | | (#7718)
* Skip non-regular files (e.g. submodules) on repo indexing (#7711)guillep2k2019-08-021-5/+13
|
* fix duplicated webhook when creating issue with assignees (#7681)Lunny Xiao2019-07-311-3/+6
|
* Move add to hook queue for created repo to outside xorm session. (#7675)David Svantesson2019-07-311-2/+15
| | | | Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Move commit repo action from models to repofiles package (#7645)Lunny Xiao2019-07-303-309/+10
| | | | | | * move commit repo action from models to repofiles package * fix unit tests
* SetDefaultBranch on pushing to empty repository (#7610)zeripath2019-07-301-0/+11
|
* change length of some repository's columns (#7652)Lunny Xiao2019-07-293-3/+23
|
* fix wrong email when use gitea as OAuth2 provider (#7640)renothing2019-07-271-4/+4
| | | | | | | 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.
* reserve .well-known username (#7637)Andreas Shimokawa2019-07-261-0/+1
|
* Fix bug create/edit wiki pages when code master branch protected (#7580)Lunny Xiao2019-07-252-5/+11
| | | | | | * fix bug create/edit wiki pages when code master branch protected * improve FullPushingEnvironment function
* Make PKCS8, PEM and SSH2 keys work (#7600)zeripath2019-07-252-27/+125
| | | | | | | | * Make PEM and SSH2 keys work * add ssh2 testcases and PEM cases - and fix PEM * Add final test to parse the proposed key
* Fix panic on push at #7611 (#7615)zeripath2019-07-251-1/+1
| | | | | | | | * 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
* Fix #7136: Add paging and extend API GetCommitStatuses (#7141)zeripath2019-07-252-4/+54
| | | | | | | | | | | | | | | | | | | | * Fix #7136: Add paging and extend API GetCommitStatuses * update swagger * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Update routers/api/v1/repo/status.go Co-Authored-By: techknowlogick <matti@mdranta.net> * Apply suggestions from code review
* Move models.PushUpdate to repofiles.PushUpdate (#7485)Lunny Xiao2019-07-242-118/+7
| | | | | | * move models.PushUpdate to repofiles.PushUpdate * remove duplicated code to load repo
* Added missing error checks in tests (#7554)Christian Muehlhaeuser2019-07-232-0/+3
| | | Whenever we assign a value to err, check for it being nil.
* Removed unnecessary conversions (#7557)Christian Muehlhaeuser2019-07-232-5/+5
| | | No need to convert to the same type.
* Improve SSH key parser to handle newlines in keys (#7522)silverwind2019-07-232-6/+28
| | | | | | | | | | | | | | | | * Strip newlines from SSH keys before adding them Fixes: https://github.com/go-gitea/gitea/issues/7500 * add test for CheckPublicKeyString * add one more test * simplify test * further simplify * make fmt
* Fixed ineffectual assignments (#7555)Christian Muehlhaeuser2019-07-221-1/+1
| | | Don't assign values we never use.
* Fixed ineffectual assignments in tests (#7553)Christian Muehlhaeuser2019-07-221-3/+3
| | | | Just makes it a bit more obvious which values we want to test for, and which ones we want to ignore.
* Fix repository's pull request count error (#7518)Lunny Xiao2019-07-183-12/+38
| | | | | | * fix pr count error * fix tests
* Include thread related headers in issue/coment mail (#7484)mrsdizzie2019-07-173-1/+115
| | | | | | | | | | | | | | * Include thread related headers in issue/coment mail Make it so mail programs will group comments from an issue into the same thread by setting Message-ID on initial issue and then using In-Reply-To and References headers to reference that later on. * Add tests * more tests * fix typo
* Update User.NumRepos atomically in createRepository (#7493)Monty Taylor2019-07-171-2/+6
| | | | | | | | The update call on the user call races if there is more than one repository creation concurrently, leading to incorrect count of repos. Split things in two, so that we call the update for last visibility (which isn't problematic if it races, since it can only ever be best-effort anyway). This way we can atomically increment the count of repos.
* Move status table to cron package (#7370)Lunny Xiao2019-07-154-42/+0
|
* Fix regex for issues in commit messages (#7444)mrsdizzie2019-07-142-1/+21
| | | | | | | | | | * Fix regex for issues in commit messages Use same regex as markup for matching in commits. Fixes #7438 * make fmt
* only return head: null if source branch was deleted (#6705)quantonganh2019-07-082-33/+67
| | | | | | | | | | * only return head: null if source branch was deleted * add URL into GetPullRequest * TestPullRequest_APIFormat * log error if it is not Err(Branch)NotExist