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
Tatuya Kamada
gitlab-ce
Commits
ee92dd16
Commit
ee92dd16
authored
Apr 26, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unescape branch names in compare commit
Closes #1399 Closes
https://github.com/gitlabhq/gitlabhq/issues/9105
parent
39a55bdf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
CHANGELOG
CHANGELOG
+2
-0
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+4
-2
spec/controllers/projects/compare_controller_spec.rb
spec/controllers/projects/compare_controller_spec.rb
+22
-0
No files found.
CHANGELOG
View file @
ee92dd16
...
...
@@ -21,6 +21,8 @@ v 7.11.0 (unreleased)
- Add default project and snippet visibility settings to the admin web UI.
-
- Fix bug where commit data would not appear in some subdirectories (Stan Hu)
- Unescape branch names in compare commit (Stan Hu)
-
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
- Move snippets UI to fluid layout
- Improve UI for sidebar. Increase separation between navigation and content
...
...
app/controllers/projects/compare_controller.rb
View file @
ee92dd16
require
'addressable/uri'
class
Projects::CompareController
<
Projects
::
ApplicationController
# Authorize
before_action
:require_non_empty_project
...
...
@@ -7,8 +9,8 @@ class Projects::CompareController < Projects::ApplicationController
end
def
show
base_ref
=
params
[
:from
]
head_ref
=
params
[
:to
]
base_ref
=
Addressable
::
URI
.
unescape
(
params
[
:from
])
head_ref
=
Addressable
::
URI
.
unescape
(
params
[
:to
])
compare_result
=
CompareService
.
new
.
execute
(
current_user
,
...
...
spec/controllers/projects/compare_controller_spec.rb
0 → 100644
View file @
ee92dd16
require
'spec_helper'
describe
Projects
::
CompareController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:ref_from
)
{
"improve%2Fawesome"
}
let
(
:ref_to
)
{
"feature"
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
end
it
'compare should show some diffs'
do
get
(
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
ref_from
,
to:
ref_to
)
expect
(
response
).
to
be_success
expect
(
assigns
(
:diffs
).
length
).
to
be
>=
1
expect
(
assigns
(
:commits
).
length
).
to
be
>=
1
end
end
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