Fix error when using invalid branch name when creating a new pipeline
## What does this MR do?
This MR fixes `500` error when creating a new pipeline though user interface ("Run pipeline")
## Are there points in the code the reviewer needs to double check?
Is this a good approach to catch those exceptions on `Repository` level?
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- Tests
- [x] Added for this feature/bug
## What are the relevant issue numbers?
Closes#23982
See merge request !7324
* upstream/master: (35 commits)
Only skip group when it's actually a group in the "Share with group" select
Fix: Todos Filter Shows All Users
Fix: Guest sees some repository details and gets 404
Move shared params to a helper
GrapeDSL for project hooks
Update commits.scss
updated styling commit SHA on branches page + added to changelog
change build list height to show 6,5 builds + improve padding of list, with first/last child selectors
Ignore builds directory from eslint
Add changelog entry
Document multiple repository storage paths
Allow multiple repository storage shards to be enabled, and automatically round-robin between them
Cleaned up global namespace JS
Add tip for using Chrome to run and debug teaspoon tests.
Add CHANGELOG entry file
Add jquery.timeago.js to application.js
Update match-regex to fix filename convention
Move jquery.timeago to vendor directory
Change a bunch of doc links to either relative or https://docs.gitlab.com.
Show log corresponding to env in admin/logs
...
* upstream/master: (126 commits)
Allow to search for user by secondary email address in the admin interface
Rename :name search parameter to :search_query at /admin/users
Fix project features default values
Add a link to the Issue Boards API in main README
Fix Markdown styling inside reference links
Fix relative links in Markdown wiki when displayed in "Project" tab
Flexbox webkit prefixes
Tests update
Tests update
Changed where merge request link is
New todos blank state
Implement CreateMembers service to make controller thin
Do not show tooltip for active element (!7105)
Update CHANGELOG
Assign local_assigns[:subject] to a variable on the shared label partial
Use select instead of pluck on Project.group_ids
Skip authorization check when searching for labels on IssuableFinder
Use label subject to calculate number of issues/mrs within the group
Remove unnecessary includes(:priorities) on Projects::LabelsController
Add 8.13.2 CHANGELOG entries
...
When we updated gitlab_git to 10.4.1, `tag.target` changed from pointing
to the sha of the tag to the sha of the commit the tag points to. The
problem is that only annotated tags have `object_sha`s, lightweight tags
don't (it's nil), so (only) in their case we still need to use
`tag.target`.
* upstream/master: (65 commits)
Fixed typo in css class
Merge branch 'airat/gitlab-ce-23268-fix-milestones-filtering' into 'master'
Escape quotes in gl_dropdown values to prevent exceptions
Fixes various errors when adding deploy keys caused by not exiting the control flow.
Fix typo on /help/ui to Alerts section
Grapify tags API
Add 8.13.1 CHANGELOG entries
Fix sidekiq stats in admin area
Remove use of wait_for_ajax since jQuery was removed
Specify which Fog storage drivers are imported by default in backup_restore.md
Moved avatar infront of labels
Don't schedule ProjectCacheWorker unless needed
Fixed height of sidebar causing scrolling issues
Reduce overhead of LabelFinder by avoiding #presence call
Fixed users profile link in sidebar Fixed new labels not being created
Improve redis config tasks for migration paths job
Ensure search val is defined.
Ensure cursor is applied to end of issues search input.
Increase debounce wait on issues search execution.
Keep the new resque.yml aside and use it once we've checked out master
...
* upstream/master: (67 commits)
Stop unauthized users dragging on issue boards
Capitalize Git
Add docker-compose environment initialization command
Improve readability and add specs for label filtering
Improve label filtering implementation
Allow the use of params[:name] when filtering labels
Fix Rubocop offenses in issue move specs
Add spec in Issues::MoveService to fix label assignment regression
Fix bug where labels would be assigned to issues that were moved
Fix `User#to_reference`
Fix rubocop build error
Remove redundant class_name and foreign_key overrides
Enable SingleLinePerSelector in scss-lint
Escape ref and path for relative links (!6050)
Add failing test for #21420
Enable SpaceAfterVariableColon in scss-lint
Enable SpaceAroundOperator in scss-lint
Enable trailingWhitespace in scss-lint
Disable Rails/Output cop since it makes no sense here
Use File.write instead of File.open + File#write
...
- Disable {project, group} members submit button if no users
If no users are selected, the submit button should be disabled.
- Alert user when no users were added to {project, group}.
When no users were selected for adding, an alert message is
flashed that no users were added.
- Also, this commit adds a feedback when users were actually added to a
project, in symmetry with how group members are handled.
Closes#22967, #23270.
Fix a 500 error viewing an MR with a deleted source project
## What does this MR do?
Allows merged MRs to be shown without any 500 errors if the source project is removed
## Are there points in the code the reviewer needs to double check?
31c37c6c38 fixed this for closed MRs only. I had trouble understanding the introduced helper and logic, so reverted it and keyed everything on the existence of the source project or branch directly.
commits.json returns a 500 error for a closed or merged MR; the approach taken in the above MR was to hide the commits... tab, so I've run with that.
For merged MRs, the commits (but not the pipeline data) are in the target project, so we *could* do better, but it's a fairly nasty intervention to make it happen.
## Why was this MR needed?
Viewing merged MRs should work even if the fork they came from has been deleted or unlinked.
## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes#23341
See merge request !6991
Removed code from project members controller
## What does this MR do?
Removes code that was meant to be added to a different branch as an experiment.
See merge request !7012
Refactoring find_commits method
It's possible that `find_commits_by_message` return nil in array which is not OK. We have different checks outside of this method. This MR places all checks inside the method.
See merge request !7000