summaryrefslogtreecommitdiff
path: root/app/services/files/base_service.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge branch '18193-developers-can-merge' into 'master' "Robert Speicher2016-07-131-1/+1
| | | | | This reverts commit 9ca633eb4c62231e4ddff5466c723cf8e2bdb25d, reversing changes made to fb229bbf7970ba908962b837b270adf56f14098f.
* Refactor `Gitlab::GitAccess`Timothy Andrew2016-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Don't use case statements for dispatch anymore. This leads to a lot of duplication, and makes the logic harder to follow. 2. Remove duplicated logic. - For example, the `can_push_to_branch?` exists, but we also have a different way of checking the same condition within `change_access_check`. - This kind of duplication is removed, and the `can_push_to_branch?` method is used in both places. 3. Move checks returning true/false to `UserAccess`. - All public methods in `GitAccess` now return an instance of `GitAccessStatus`. Previously, some methods would return true/false as well, which was confusing. - It makes sense for these kinds of checks to be at the level of a user, so the `UserAccess` class was repurposed for this. The prior `UserAccess.allowed?` classmethod is converted into an instance method. - All external uses of these checks have been migrated to use the `UserAccess` class 4. Move the "change_access_check" into a separate class. - Create the `GitAccess::ChangeAccessCheck` class to run these checks, which are quite substantial. - `ChangeAccessCheck` returns an instance of `GitAccessStatus` as well. 5. Break out the boolean logic in `ChangeAccessCheck` into `if/else` chains - this seems more readable. 6. I can understand that this might look like overkill for !4892, but I think this is a good opportunity to clean it up. - http://martinfowler.com/bliki/OpportunisticRefactoring.html
* Services: code style fixes, minor refactoringservices_refactoring1Valery Sizov2016-07-061-4/+3
|
* Revert back to not defining a default Git access protocol.Patricio Cano2016-07-051-1/+1
|
* Default Git access protocol to `web`Patricio Cano2016-07-051-1/+1
|
* Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell ↵Patricio Cano2016-07-051-1/+1
| | | | expects and make the `protocol` param in `GitAccess` mandatory.
* Automatically fork a project when not allowed to edit a file.Douwe Maan2015-12-181-14/+12
|
* Make tooltip less confusingDouwe Maan2015-12-081-1/+1
|
* Show tooltip when trying to edit file when not on branchDouwe Maan2015-12-081-1/+1
|
* Run custom Git hooks when creating or deleting branches through the UI. #1156Rubén Dávila2015-12-031-1/+1
|
* Fix rubocop warnings in appGuilherme Garnier2015-10-031-1/+1
|
* Refactor how repository makes commit with pre/post receive hooksDmitriy Zaporozhets2015-08-141-1/+1
|
* Capture pre-receive exceptionDmitriy Zaporozhets2015-08-131-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Implement commit transaction with pre-receive and post-receive hooks for web ↵Dmitriy Zaporozhets2015-08-131-5/+0
| | | | | | editor Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert "Merge branch 'revert-satellites' into 'master' "Dmitriy Zaporozhets2015-08-111-7/+70
| | | | | This reverts commit 5daf44b7c86e0e2641a902b1da8b01d91fa3dbfa, reversing changes made to 2f706fbd231cabe7a76a5d17ac44285aaaf8592c.
* Revert "Create activity event and execute hooks on web editor commit"Dmitriy Zaporozhets2015-08-111-6/+0
| | | | This reverts commit 3d416f1682c5e6a6ac1ea7013f66bbd0d23b452c.
* Revert "Make web editor work correctly after switch from satellites"Dmitriy Zaporozhets2015-08-111-2/+1
| | | | This reverts commit 435f680b897b892103fa157d4699dbb6d9ecf758.
* Revert "Refactor web editor"Dmitriy Zaporozhets2015-08-111-70/+7
| | | | | | This reverts commit dfccb06dda344819989fa8d6a9a3c56c5ca0b65f. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert "Merge branch 'drop-satellites'"Dmitriy Zaporozhets2015-08-111-1/+8
| | | | | | | This reverts commit 957e849f41d96fa9778fcdd06792d2f0274b29ab, reversing changes made to 6b9dbe9f5a175a8162abf296367f561bab3eea1a. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Huge refactoring for accepting merge requestsDmitriy Zaporozhets2015-07-161-8/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Refactor web editorrefactor-web-editorDmitriy Zaporozhets2015-06-051-7/+70
| | | | | | | | | | * fix problem with editing non-master branch * before commit make sure branch exists * dont allow user change file in one branch and commit to another existing branch * remove a lot of code duplication * remove outdated statellite errors Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Make web editor work correctly after switch from satellitesDmitriy Zaporozhets2015-06-021-1/+2
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Create activity event and execute hooks on web editor commitDmitriy Zaporozhets2015-06-021-0/+6
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Use :message key, not :error for File::Service.Ciro Santilli2014-10-131-6/+0
|
* Factor error and success methods from services.Ciro Santilli2014-09-211-11/+3
|
* Move all Context classes into ServicesDmitriy Zaporozhets2014-01-161-0/+31
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>