Commit 3fd62a46 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'sh-fix-unknown-constant' into 'master'

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

See merge request gitlab-org/gitlab-ee!6514
parents c975e29e d4787bf5
......@@ -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