Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-02-07 20:56:51 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-02-19 21:14:51 +0300
commit6b0e4783530f58d7bd9e425f21c170b83a8d0dfa (patch)
treed97b82bcae7a6fcb1195ef33b80522c3630a8842 /app/services/commits/revert_service.rb
parent91e6e32d130308496065d2efbf71d61e0eeff784 (diff)
Some fixes required for conflicts on revert.
Diffstat (limited to 'app/services/commits/revert_service.rb')
-rw-r--r--app/services/commits/revert_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/commits/revert_service.rb b/app/services/commits/revert_service.rb
index 730e2017e8d..5ac2853019b 100644
--- a/app/services/commits/revert_service.rb
+++ b/app/services/commits/revert_service.rb
@@ -14,7 +14,9 @@ module Commits
if commit
success
else
- error("Something went wrong. Your changes were not committed")
+ error("Sorry, we cannot revert this commit automatically.
+ It may have already been reverted, or a more recent commit may
+ have updated some of its content.")
end
rescue Repository::CommitError, Gitlab::Git::Repository::InvalidBlobName, GitHooksService::PreReceiveError, ValidationError => ex
error(ex.message)
@@ -26,7 +28,7 @@ module Commits
# Create branch with revert commit
reverted = repository.revert(current_user, @commit, @target_branch, @create_merge_request)
- unless @create_merge_request
+ if reverted && !@create_merge_request
repository.rm_branch(current_user, @commit.revert_branch_name)
end