diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-02-08 11:16:04 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-19 13:14:51 -0500 |
commit | e22cdb40ec29178576a147a62e7bfe119ada9a25 (patch) | |
tree | ab7a95e25acb00f17e596a3d918caa835d6fd307 /app/services | |
parent | 4dc835051705d5354645d39823b390f40175dbb2 (diff) | |
download | gitlab-ce-e22cdb40ec29178576a147a62e7bfe119ada9a25.tar.gz |
Big refactor for #revert_commit.
* Now checking if a commit is already reverted or there is a conflict is
much more faster.
* No longer need to create a new branch.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/commits/revert_service.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/app/services/commits/revert_service.rb b/app/services/commits/revert_service.rb index 5ac2853019b..dd8a92a2d87 100644 --- a/app/services/commits/revert_service.rb +++ b/app/services/commits/revert_service.rb @@ -23,16 +23,7 @@ module Commits end def commit - raw_repo = repository.rugged - - # Create branch with revert commit - reverted = repository.revert(current_user, @commit, @target_branch, @create_merge_request) - - if reverted && !@create_merge_request - repository.rm_branch(current_user, @commit.revert_branch_name) - end - - reverted + repository.revert(current_user, @commit, @target_branch, @create_merge_request) end private |