summaryrefslogtreecommitdiff
path: root/app/services/create_branch_service.rb
Commit message (Collapse)AuthorAgeFilesLines
* Move GitHooksService to Gitlab::GitJacob Vosmaer2017-08-231-1/+1
|
* Fix CreateBranchService after Repository#commit_file was renamed to create_fileAdam Niedzielski2017-03-211-3/+3
| | | | Closes #29687
* Create master branch first if project is repository-lessValery Sizov2017-02-231-0/+14
|
* Prefer leading dots over trailing dotsLin Jen-Shin2017-01-051-2/+2
|
* Simply give result if result[:status] == :errorLin Jen-Shin2016-12-081-11/+3
|
* Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-11-241-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix-git-hooks-when-creating-file * upstream/master: (141 commits) Log mv_namespace parameters Remove header ids from University docs Added test that checks the correct select box is there for the LFS enabled setting. Simplify copy on "Create a new list" dropdown in Issue Boards Fix `LFS enabled` select box. Use Commit#author so we share logic and cache Move admin abuse report spinach test to rspec fixes non-retina shadow and browser zoom issue Use default `closest` if available! Adds polyfill for CustomEvent Move abuse report spinach test to rspec Add support of Chrome/Chromium in requirements.md Fixed dragging issues on issue boards Grapify the sidekiq metrics API Add nested groups support to the routing Correctly determine mergeability of MR with no discussions API: Add endpoint to delete a group share Add a starting date to milestones Update ProjectTeam#fetch_members to use project authorizations Update ProjectTeam#max_member_access_for_user_ids to use project authorizations ...
| * Remove unnecessary require_relative calls from service classesSemyon Pupkov2016-11-221-2/+0
| | | | | | | | | | Rails by default use autoload for all dirs from app folder. require_relative not needed. See ActiveSupport::Dependencies.autoload_paths
* | Move all branch creation to raw_ensure_branch,Lin Jen-Shin2016-11-221-6/+2
| | | | | | | | and keep it only called in update_branch_with_hooks.
* | Make sure we have the branch on the other projectLin Jen-Shin2016-11-151-9/+1
| |
* | Add `source_branch` option for various git operationsLin Jen-Shin2016-11-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | If `source_branch` option is passed, and target branch cannot be found, `Repository#update_branch_with_hooks` would try to create a new branch from `source_branch`. This way, we could make changes in the new branch while only firing the hooks once for the changes. Previously, we can only create a new branch first then make changes to the new branch, firing hooks twice. This behaviour is bad for CI. Fixes #7237
* | Revert "Don't execute git hooks if you create branch as part of other change"Lin Jen-Shin2016-11-151-2/+2
| | | | | | | | This reverts commit a431ca0f8b7f8967e89a35caddf1e41e53eee290.
* | Don't execute git hooks if you create branch as part of other changeKamil Trzcinski2016-11-021-2/+2
|/ | | | | | | | | | | Currently, our procedure for adding a commit requires us to execute `CreateBranchService` before file creation. It's OK, but also we do execute `git hooks` (the `PostReceive` sidekiq job) as part of this process. However, this hook is execute before the file is actually committed, so the ref is updated. Secondly, we do execute a `git hooks` after committing file and updating ref. This results in duplicate `PostReceive` jobs, where the first one is completely invalid. This change makes the branch creation, something that is intermediate step of bigger process (file creation or update, commit cherry pick or revert) to not execute git hooks.
* Fix of 'Commits being passed to custom hooks are already reachable when ↵Valery Sizov2016-07-191-15/+13
| | | | using the UI'
* Services: code style fixes, minor refactoringservices_refactoring1Valery Sizov2016-07-061-5/+5
|
* Better message for git hooks and file locksValery Sizov2016-07-041-2/+2
|
* Use a similar approach to branch creation for tag creationuse-rugged-to-create-tagRémy Coutable2016-05-041-5/+0
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix duplicated branch creation/deletion Web hooks/service notifications when ↵Stan Hu2016-02-091-5/+1
| | | | | | | | | | | | | | | | | | | using Web UI Similar to 423d2d6, except duplicates occurred only if a Web service (e.g. Slack) were configured. When deleting a branch, this is what was happening: 1. DeleteBranchService calls execute_hooks and execute_services 2. The call to repository.rm_branch triggers the GitHooksService. 3. This, in turn, calls GitPushService and then calls the same hooks/services again. 5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to execute the branch hooks/services. Note that tags behave differently in GitTagPushService and GitPushService is not called. Closes #10330
* Fix duplicated branch creation/deletion events when using Web UIStan Hu2016-01-081-1/+0
| | | | | | | | | | | | When deleting a branch, this is what was happening: 1. DeleteBranchService calls EventCreateService and creates an event. 2. The call to repository.rm_branch triggers the GitHooksService. 3. This, in turn, calls GitPushService and then calls EventCreateService again. 5145706c now makes it no longer necessary for DeleteBranchService and CreateBranchService to create an event. Closes #4304
* Merge branch 'edit-on-fork' into 'master' Dmitriy Zaporozhets2015-12-241-2/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically fork a project when not allowed to edit a file. Fixes #3215. To do: - [ ] Add tests ----- ## "Edit" button on file in a project the user does NOT have write access to ![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png) ## Clicking will automatically create a fork ![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png) ## When the fork has been created, the user is returned to the edit page on the original project with a notice ![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png) ## The user cannot change the target branch and is informed that editing will start an MR ![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png) ## Hitting "Commit changes" will commit and start an MR from my fork to the origin project ![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png) ----- ## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to ![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png) ## Clicking any of these options will automatically create a fork ![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png) ## When the fork has been created, the user is returned to the tree page on the original project with a notice ![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png) ## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR ![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png) ## Hitting "Create directory" will commit and start an MR from my fork to the origin project ![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png) cc @dzaporozhets @skyruler See merge request !2145
| * Automatically fork a project when not allowed to edit a file.Douwe Maan2015-12-181-2/+15
| |
* | Add JS validation for invalid characters in branch nameDouglas Barbosa Alexandre2015-12-171-1/+1
| | | | | | | | | | | | | | More info about valid ref names: https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.ht ml
* | Add more descriptive error message when create branch with invalid nameDouglas Barbosa Alexandre2015-12-161-1/+1
|/
* Run custom Git hooks when creating or deleting branches through the UI. #1156Rubén Dávila2015-12-031-2/+3
|
* Ecevute hooks and services when branches are created/deleted through web.Douwe Maan2015-03-131-0/+2
|
* Use PushDataBuilder where applicable.Douwe Maan2015-03-131-3/+11
|
* Move all event creation to EventCreateService.Douwe Maan2015-02-131-1/+1
|
* Factor error and success methods from services.Ciro Santilli2014-09-211-13/+7
|
* Validate branch-names and references in WebUI, APIRobert Schilling2014-09-031-1/+26
| | | | Add specs for GitRefValidator
* Move branch creation logic in serviceDmitriy Zaporozhets2014-04-011-0/+13
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>