Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
45b18365
Commit
45b18365
authored
Apr 19, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an issue with MR unavailable if remove source branch
parent
ac3c23f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+8
-5
No files found.
app/controllers/merge_requests_controller.rb
View file @
45b18365
...
...
@@ -34,11 +34,14 @@ class MergeRequestsController < ApplicationController
end
def
show
unless
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
target_branch
)
&&
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
source_branch
)
git_not_found!
and
return
end
# Show git not found page if target branch doesnt exist
return
git_not_found!
unless
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
target_branch
)
# Show git not found page if source branch doesnt exist
# and there is no saved commits between source & target branch
return
git_not_found!
if
!
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
source_branch
)
&&
@merge_request
.
commits
.
blank?
# Build a note object for comment form
@note
=
@project
.
notes
.
new
(
:noteable
=>
@merge_request
)
# Get commits from repository
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment