summaryrefslogtreecommitdiffstats
path: root/models/repo.go
Commit message (Collapse)AuthorAgeFilesLines
* Clean up various use of escape/unescape functions for URL generation (#6334)mrsdizzie2019-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
* Fix reported issue in repo description (#6306)zeripath2019-03-111-3/+5
|
* Fix renames over redirects (#6216)James E. Blair2019-03-021-1/+17
| | | | | | | | | | | | | | | | In #6211, we started creating repo_redirects for ownership transfers, however that opens an edge case where a user might perform the following sequence: rename org1/repo1 -> org1/repo2 (creates org1/repo1 redirect) transfer org2/repo1 -> org1/repo1 (org1/repo1 redirect continues to exist) rename org1/repo1 -> org1/repo3 (fails due to existing org1/repo1 redirect) This change ensures that each time we rename or transfer a repo, we delete any existing redirects at the target location. This already happens when a new repo is created. By doing this we ensure that we'll never have both a repo and a redirect at the same location. Signed-off-by: James E. Blair <jeblair@redhat.com>
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-101-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #5957 * add tests to make sure config option is respected * use already defined struct * - use migration to make the flag repo wide not for the entire gitea instance Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created - fix copy/paste error in copyright header year and rearrange import - use repo config instead of server config value to determine if a commit should close an issue - update testsuite * use global config only when creating a new repository * allow repo admin toggle feature via UI * fix typo and improve testcase * fix fixtures * add DEFAULT prefix to config value * fix test
* disable git fsck for mirrored repos by default (#6018)Lanre Adelowo2019-02-091-1/+1
|
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-031-0/+17
| | | | | | | | | | | | | | | | 1. A key can either be an ssh user key or a deploy key. It cannot be both. 2. If a key is a user key - it can only be associated with one user. 3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different. 4. If a repository is deleted, its deploy keys must be deleted too. We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints: - [x] You should not be able to add the same user key as another user - [x] You should not be able to add a ssh user key which is being used as a deploy key - [x] You should not be able to add a ssh deploy key which is being used as a user key - [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode. - [x] If you delete a repository you must delete all its deploy keys. Fix #1357
* show user who created the repository instead of the organization in action ↵Lanre Adelowo2019-02-041-2/+2
| | | | feed (#5948)
* Remove all CommitStatus when a repo is deleted (#5940)John Olheiser2019-02-021-0/+1
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix go-get URL generation (#5905)Lauris BH2019-01-301-1/+2
|
* Config option to disable automatic repo watching (#5852)sebastian-sauer2019-01-271-5/+8
| | | | | | | | | Add a new config option to enable / disable the automatic watching of repos for new repositories and if a user is added to a team. Fixes #653 Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
* When creating new repository fsck option should be enabled (#5817)Lauris BH2019-01-231-6/+7
|
* Feature: Archive repos (#5009)kolaente2019-01-231-2/+11
|
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-171-9/+9
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Ensure that sessions are passed into queries that could use the database to ↵zeripath2019-01-131-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prevent deadlocks (#5718) * Fixed deadlock in CreateComment * Fix possible deadlock in UpdateIssueDeadline from createDeadlineComment * Ensure that calls to IsTimeTracker enabled are called within session Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure that calls to reactionList are also called within session Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure all calls in NewPullRequest with the session are called within the session Signed-off-by: Andrew Thornton <art27@cantab.net> * Deal with potential deadlocks in repo Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure that isStaring is checked within our transaction Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix mistake in isOrganizationMember Sorry.
* Add rebase with merge commit merge style (#3844) (#4052)Julian2018-12-271-1/+1
| | | Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
* fix forgot deletion of notification when delete repository (#5506)Lunny Xiao2018-12-101-0/+1
|
* Fix repository deletion when there is large number of issues in it (#5426)Lunny Xiao2018-11-301-39/+40
|
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-281-85/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* fix bug when users have serval teams with different units on different ↵Lunny Xiao2018-11-091-1/+1
| | | | repositories (#5307)
* fix data race on migrate repository (#5224)Lunny Xiao2018-10-301-3/+8
|
* fix sqlite lock (#5210)Lunny Xiao2018-10-301-1/+1
|
* fix sqlite lock (#5184)Lunny Xiao2018-10-271-1/+5
| | | | | | | | | | | | * fix sqlite lock * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com> * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com>
* Fix race on updatesize (#5190)Lunny Xiao2018-10-261-2/+2
| | | | | | * fix race on updatesize * fix more repoPath
* Fix sqlite lock (#5176)Lunny Xiao2018-10-251-2/+6
| | | | | | * fix sqlite lock * fix sqlite lock on getUnitType
* Fix deadlock when sqlite (#5118)Lunny Xiao2018-10-191-13/+17
| | | | | | * fix deadlock when sqlite * fix clonelink deadlock on sqlite
* fix bug forget to remove Stopwatch when remove repository (#4928)linweijie20122018-09-131-0/+3
|
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)Lunny Xiao2018-08-091-1/+1
| | | | | | * site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structure
* Update xorm to latest version and fix correct `user` table referencing in ↵Lauris BH2018-07-201-1/+1
| | | | sql (#4473)
* Added dependencies for issues (#2196) (#2531)kolaente2018-07-171-1/+5
|
* Add default merge options when adding new repository (#4369)Lauris BH2018-07-051-0/+6
|
* Add `noreferrer` to rel='noopener` for <a> tags (#4328)cezar972018-07-031-1/+1
|
* hide issues from org private repos w/o team assignment (#4034)David Schneiderbauer2018-06-211-13/+5
|
* Fix not removed watches on unallowed repositories (#4201)David Schneiderbauer2018-06-191-0/+3
|
* Delete reactions added to issues and comments when deleting repository (#4232)Lauris BH2018-06-121-0/+3
|
* fix #4003 (#4004)奶爸2018-05-211-0/+2
| | | Webhook and hook_task not cleaned up when delete repository
* Fix some webhooks bugs (#3981)Lunny Xiao2018-05-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | * fix some webhooks bugs * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix test * fix clearlabels * fix pullrequest webhook bug fix #3492 * update release webhook description * remove unused code * fix push webhook in pull request * small changes
* Add more webhooks support and refactor webhook templates directory (#3929)Lunny Xiao2018-05-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * load attributes when created release * update comparsion doc
* Multiple assignees (#3705)kolaente2018-05-091-3/+3
|
* Fix to use only needed columns from tables to get repository git paths (#3870)Lauris BH2018-05-021-3/+47
|
* Fix path cleanup in multiple places (#3871)Lauris BH2018-05-011-1/+1
|
* Add topic support (#3711)Lunny Xiao2018-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * add topic models and unit tests * fix comments * fix comment * add the UI to show or add topics for a repo * show topics on repositories list * fix test * don't show manage topics link when no permission * use green basic as topic label * fix topic label color * remove trace content * remove debug function
* Add repository setting to enable/disable health checks (#3607)Allen Wild2018-03-271-2/+3
| | | | | | | | | | | | | | New Feature: * Repository struct field for IsFsckEnabled (default true of course) * Admin Settings section on repo options page, accessible only by admin users Possible Enhancements: * There's no way to force running health checks on all repos regardless of their IsFsckEnabled setting. This would be useful if there were an admin API or dashboard button to run fsck immediately. Issue: https://github.com/go-gitea/gitea/issues/1712 Signed-off-by: Allen Wild <allenwild93@gmail.com>
* Global code search support (#3664)Lunny Xiao2018-03-161-0/+6
| | | | | | | | | | | | * add global code search on explore * fix bug when no anyone public repos * change the icon * fix typo and add UnitTypeCode check for login non-admin user * fix ui description when no match
* Add admin dashboard option to run health checks (#3606)Allen Wild2018-03-021-0/+2
| | | | | There's one for git gc, why not git fsck too? Also add a couple more trace logs to GitFsck to see progress
* Fix race condition in repo renaming (#3418)Ethan Koenig2018-01-281-1/+6
|
* Fix empty checkout bug (#3419)Ethan Koenig2018-01-281-6/+6
|
* Change local copy origin url after repository rename (#3399)Wendell Sun2018-01-271-1/+10
| | | Fix #3378
* Add Pull Request merge options - Ignore white-space for conflict checking, ↵Lauris BH2018-01-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rebase, Squash merge (#3188) * Pull request options migration and UI in settings * Add ignore whitespace functionality * Fix settings if pull requests are disabled * Fix migration transaction * Merge with Rebase functionality * UI changes and related functionality for pull request merging button * Implement squash functionality * Fix rebase merging * Fix pull request merge tests * Add squash and rebase tests * Fix API method to reuse default message functions * Some refactoring and small fixes * Remove more hardcoded values from tests * Remove unneeded check from API method * Fix variable name and comment typo * Fix reset commit count after PR merge
* Serve pull request .diff files (#3293)Sandro Santilli2018-01-051-1/+3
| | | | | | | | | | | | * Serve pull request .diff files Closes #3259 * Add test for pull request redirection and .diff access * Typo * There's no need to test for pr.BaseRepo being nil after calling GetBaseRepo
* Remove unused consts/vars (#3270)Ethan Koenig2017-12-301-13/+0
|