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
d8cc8d7a
Commit
d8cc8d7a
authored
Nov 06, 2016
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'extended_sha1' option from ExtractsPath module
parent
d02f7d29
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
app/controllers/projects/network_controller.rb
app/controllers/projects/network_controller.rb
+1
-0
app/views/projects/network/show.html.haml
app/views/projects/network/show.html.haml
+1
-1
lib/extracts_path.rb
lib/extracts_path.rb
+8
-12
No files found.
app/controllers/projects/network_controller.rb
View file @
d8cc8d7a
...
@@ -9,6 +9,7 @@ class Projects::NetworkController < Projects::ApplicationController
...
@@ -9,6 +9,7 @@ class Projects::NetworkController < Projects::ApplicationController
def
show
def
show
@url
=
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@ref
,
@options
.
merge
(
format: :json
))
@url
=
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@ref
,
@options
.
merge
(
format: :json
))
@commit_url
=
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
'ae45ca32'
).
gsub
(
"ae45ca32"
,
"%s"
)
@commit_url
=
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
'ae45ca32'
).
gsub
(
"ae45ca32"
,
"%s"
)
@commit
=
@repo
.
commit
(
params
[
:extended_sha1
])
if
params
[
:extended_sha1
].
present?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
...
...
app/views/projects/network/show.html.haml
View file @
d8cc8d7a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
.project-network
.project-network
.controls
.controls
=
form_tag
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@id
),
method: :get
,
class:
'form-inline network-form'
do
|
f
|
=
form_tag
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@id
),
method: :get
,
class:
'form-inline network-form'
do
|
f
|
=
text_field_tag
:extended_sha1
,
@option
s
[
:extended_sha1
],
placeholder:
"Git revision"
,
class:
'search-input form-control input-mx-250 search-sha'
=
text_field_tag
:extended_sha1
,
param
s
[
:extended_sha1
],
placeholder:
"Git revision"
,
class:
'search-input form-control input-mx-250 search-sha'
=
button_tag
class:
'btn btn-success'
do
=
button_tag
class:
'btn btn-success'
do
=
icon
(
'search'
)
=
icon
(
'search'
)
.inline.prepend-left-20
.inline.prepend-left-20
...
...
lib/extracts_path.rb
View file @
d8cc8d7a
...
@@ -106,7 +106,7 @@ module ExtractsPath
...
@@ -106,7 +106,7 @@ module ExtractsPath
# resolved (e.g., when a user inserts an invalid path or ref).
# resolved (e.g., when a user inserts an invalid path or ref).
def
assign_ref_vars
def
assign_ref_vars
# assign allowed options
# assign allowed options
allowed_options
=
[
"filter_ref"
,
"extended_sha1"
]
allowed_options
=
[
"filter_ref"
]
@options
=
params
.
select
{
|
key
,
value
|
allowed_options
.
include?
(
key
)
&&
!
value
.
blank?
}
@options
=
params
.
select
{
|
key
,
value
|
allowed_options
.
include?
(
key
)
&&
!
value
.
blank?
}
@options
=
HashWithIndifferentAccess
.
new
(
@options
)
@options
=
HashWithIndifferentAccess
.
new
(
@options
)
...
@@ -114,9 +114,6 @@ module ExtractsPath
...
@@ -114,9 +114,6 @@ module ExtractsPath
@ref
,
@path
=
extract_ref
(
@id
)
@ref
,
@path
=
extract_ref
(
@id
)
@repo
=
@project
.
repository
@repo
=
@project
.
repository
if
@options
[
:extended_sha1
].
present?
@commit
=
@repo
.
commit
(
@options
[
:extended_sha1
])
else
@commit
=
@repo
.
commit
(
@ref
)
@commit
=
@repo
.
commit
(
@ref
)
if
@path
.
empty?
&&
!
@commit
&&
@id
.
ends_with?
(
'.atom'
)
if
@path
.
empty?
&&
!
@commit
&&
@id
.
ends_with?
(
'.atom'
)
...
@@ -127,7 +124,6 @@ module ExtractsPath
...
@@ -127,7 +124,6 @@ module ExtractsPath
end
end
raise
InvalidPathError
unless
@commit
raise
InvalidPathError
unless
@commit
end
@hex_path
=
Digest
::
SHA1
.
hexdigest
(
@path
)
@hex_path
=
Digest
::
SHA1
.
hexdigest
(
@path
)
@logs_path
=
logs_file_namespace_project_ref_path
(
@project
.
namespace
,
@logs_path
=
logs_file_namespace_project_ref_path
(
@project
.
namespace
,
...
...
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