Commit d4787bf5 authored by Stan Hu's avatar Stan Hu

Fix undefined constant Gitlab::Git::HooksService::PreReceiveError

Part of gitlab-org/gitlab-ce#49263
parent d7eb6972
......@@ -49,7 +49,7 @@ module Projects
else
begin
repository.ff_merge(current_user, upstream_branch.dereferenced_target, name)
rescue Gitlab::Git::HooksService::PreReceiveError, Gitlab::Git::CommitError => e
rescue Gitlab::Git::PreReceiveError, Gitlab::Git::CommitError => e
errors << e.message
end
end
......
......@@ -25,6 +25,14 @@ describe Projects::UpdateMirrorService do
described_class.new(project, project.owner).execute
end
it 'rescues exceptions from Repository#ff_merge' do
stub_fetch_mirror(project)
expect(project.repository).to receive(:ff_merge).and_raise(Gitlab::Git::PreReceiveError)
expect { described_class.new(project, project.owner).execute }.not_to raise_error
end
it "succeeds" do
stub_fetch_mirror(project)
......
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