Commit 46f8e642 authored by Sean McGivern's avatar Sean McGivern Committed by Fatih Acet

Remove undo endpoint

This reverts commit 2536fea8db0967a817615eb3e951eb6ba22f8ede.
parent ba327e69
...@@ -10,8 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -10,8 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :module_enabled before_action :module_enabled
before_action :merge_request, only: [ before_action :merge_request, only: [
:edit, :update, :show, :diffs, :commits, :conflicts, :builds, :merge, :merge_check, :edit, :update, :show, :diffs, :commits, :conflicts, :builds, :merge, :merge_check,
:ci_status, :toggle_subscription, :cancel_merge_when_build_succeeds, :remove_wip, :resolve_conflicts, :ci_status, :toggle_subscription, :cancel_merge_when_build_succeeds, :remove_wip, :resolve_conflicts
:undo_last_resolution
] ]
before_action :validates_merge_request, only: [:show, :diffs, :commits, :builds] before_action :validates_merge_request, only: [:show, :diffs, :commits, :builds]
before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :builds] before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :builds]
...@@ -158,16 +157,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -158,16 +157,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
end end
def undo_last_resolution
rugged = @merge_request.project.repository.rugged
ref = Gitlab::Git::BRANCH_REF_PREFIX + @merge_request.source_branch
prev = rugged.ref(ref).target
rugged.references.update(ref, prev.parents.first.oid) if prev.parents.length == 2
head :ok
end
def builds def builds
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -729,7 +729,6 @@ Rails.application.routes.draw do ...@@ -729,7 +729,6 @@ Rails.application.routes.draw do
post :remove_wip post :remove_wip
get :diff_for_path get :diff_for_path
post :resolve_conflicts post :resolve_conflicts
post :undo_last_resolution
end end
collection do collection do
......
...@@ -639,19 +639,6 @@ describe Projects::MergeRequestsController do ...@@ -639,19 +639,6 @@ describe Projects::MergeRequestsController do
it 'returns an OK resposne' do it 'returns an OK resposne' do
expect(response).to have_http_status(:ok) expect(response).to have_http_status(:ok)
end end
context 'undoing the resolution' do
before do
post :undo_last_resolution,
namespace_id: merge_request_with_conflicts.project.namespace.to_param,
project_id: merge_request_with_conflicts.project.to_param,
id: merge_request_with_conflicts.iid
end
it 'undoes the commit' do
expect(original_head_sha).to eq(merge_request_with_conflicts.source_branch_head.sha)
end
end
end end
context 'when sections are missing' do context 'when sections are missing' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment