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
75523d1d
Commit
75523d1d
authored
May 03, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanitize repo paths in new project error message
Closes #17243
parent
8be1118a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
CHANGELOG
CHANGELOG
+1
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+6
-0
app/views/projects/imports/new.html.haml
app/views/projects/imports/new.html.haml
+1
-1
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+9
-0
No files found.
CHANGELOG
View file @
75523d1d
...
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased)
- Project#open_branches has been cleaned up and no longer loads entire records into memory.
- Make build status canceled if any of the jobs was canceled and none failed
- Sanitize repo paths in new project error message
- Remove future dates from contribution calendar graph.
- Support e-mail notifications for comments on project snippets
- Use ActionDispatch Remote IP for Akismet checking
...
...
app/helpers/projects_helper.rb
View file @
75523d1d
...
...
@@ -341,4 +341,10 @@ module ProjectsHelper
)
end
end
def
sanitize_repo_path
(
message
)
return
''
unless
message
.
present?
message
.
strip
.
gsub
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
.
chomp
(
'/'
),
"[REPOS PATH]"
)
end
end
app/views/projects/imports/new.html.haml
View file @
75523d1d
...
...
@@ -10,7 +10,7 @@
.panel-body
%pre
:preserve
#{
@project
.
import_error
.
try
(
:strip
)
}
#{
sanitize_repo_path
(
@project
.
import_error
)
}
=
form_for
@project
,
url:
namespace_project_import_path
(
@project
.
namespace
,
@project
),
method: :post
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
=
render
"shared/import_form"
,
f:
f
...
...
spec/helpers/projects_helper_spec.rb
View file @
75523d1d
...
...
@@ -131,4 +131,13 @@ describe ProjectsHelper do
end
end
end
describe
'#sanitized_import_error'
do
it
'removes the repo path'
do
repo
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
'/namespace/test.git'
)
import_error
=
"Could not clone
#{
repo
}
\n
"
expect
(
sanitize_repo_path
(
import_error
)).
to
eq
(
'Could not clone [REPOS PATH]/namespace/test.git'
)
end
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