Commit 15d156fa authored by Rémy Coutable's avatar Rémy Coutable Committed by Alejandro Rodríguez
Browse files

Merge branch '24627-fix-bad-mr-error-message' into 'master'

Fixes regression causing an error message to appear when user first enters the Merge Request form.

Closes #24627

See merge request !7599
parent a79b003a
......@@ -48,11 +48,11 @@ def validate_branches(merge_request)
end
# See if source and target branches exist
unless merge_request.source_project.commit(merge_request.source_branch)
if merge_request.source_branch.present? && !merge_request.source_project.commit(merge_request.source_branch)
messages << "Source branch \"#{merge_request.source_branch}\" does not exist"
end
unless merge_request.target_project.commit(merge_request.target_branch)
if merge_request.target_branch.present? && !merge_request.target_project.commit(merge_request.target_branch)
messages << "Target branch \"#{merge_request.target_branch}\" does not exist"
end
......
---
title: Fix regression causing bad error message to appear on Merge Request form
merge_request: 7599
author: Alex Sanford
......@@ -77,4 +77,11 @@
expect(page).to have_content "6049019_460s.jpg"
end
end
# Isolates a regression (see #24627)
it 'does not show error messages on initial form' do
visit new_namespace_project_merge_request_path(project.namespace, project)
expect(page).not_to have_selector('#error_explanation')
expect(page).not_to have_content('The form contains the following error')
end
end
Supports Markdown
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