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:
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