summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-02 18:11:23 -0600
committerDouwe Maan <douwe@selenight.nl>2017-03-02 18:11:23 -0600
commitcaed61adeee1b5f1bf6943abd53e381ca31588c6 (patch)
treebca52ed45e49d5f4df0bfac65744f0067ebea61d /app/models
parent6cc4cf1e151fb8da16796d7bbab16bc8a1ac08b6 (diff)
downloadgitlab-ce-caed61adeee1b5f1bf6943abd53e381ca31588c6.tar.gz
Use separate error class for cherry-pick and revert tree errors
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 4f8b436ee16..e7cc8d6e083 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -6,6 +6,7 @@ class Repository
attr_accessor :path_with_namespace, :project
CommitError = Class.new(StandardError)
+ CreateTreeError = Class.new(StandardError)
# Methods that cache data from the Git repository.
#
@@ -871,7 +872,7 @@ class Repository
revert_tree_id = check_revert_content(commit, start_commit.sha)
unless revert_tree_id
- raise Repository::CommitError.new('Failed to revert commit')
+ raise Repository::CreateTreeError.new('Failed to revert commit')
end
committer = user_to_committer(user)
@@ -895,7 +896,7 @@ class Repository
cherry_pick_tree_id = check_cherry_pick_content(commit, start_commit.sha)
unless cherry_pick_tree_id
- raise Repository::CommitError.new('Failed to cherry-pick commit')
+ raise Repository::CreateTreeError.new('Failed to cherry-pick commit')
end
committer = user_to_committer(user)