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
Boxiang Sun
gitlab-ce
Commits
40470975
Commit
40470975
authored
Nov 11, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Project#safe_import_url helper.
parent
841a7c68
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-8
app/models/project.rb
app/models/project.rb
+8
-0
app/views/projects/imports/show.html.haml
app/views/projects/imports/show.html.haml
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
40470975
...
...
@@ -253,14 +253,6 @@ module ProjectsHelper
filename_path
(
project
,
:version
)
end
def
hidden_pass_url
(
original_url
)
result
=
URI
(
original_url
)
result
.
password
=
'*****'
unless
result
.
password
.
nil?
result
rescue
original_url
end
def
project_wiki_path_with_version
(
proj
,
page
,
version
,
is_newest
)
url_params
=
is_newest
?
{}
:
{
version_id:
version
}
namespace_project_wiki_path
(
proj
.
namespace
,
proj
,
page
,
url_params
)
...
...
app/models/project.rb
View file @
40470975
...
...
@@ -348,6 +348,14 @@ class Project < ActiveRecord::Base
import_status
==
'finished'
end
def
safe_import_url
result
=
URI
.
parse
(
self
.
import_url
)
result
.
password
=
'*****'
unless
result
.
password
.
nil?
result
.
to_s
rescue
original_url
end
def
check_limit
unless
creator
.
can_create_project?
or
namespace
.
kind
==
'group'
errors
[
:limit_reached
]
<<
(
"Your project limit is
#{
creator
.
projects_limit
}
projects! Please contact your administrator to increase it"
)
...
...
app/views/projects/imports/show.html.haml
View file @
40470975
...
...
@@ -8,7 +8,7 @@
-
else
Import in progress.
-
unless
@project
.
forked?
%p
.monospace
git clone --bare
#{
hidden_pass_url
(
@project
.
import_url
)
}
%p
.monospace
git clone --bare
#{
@project
.
safe_import_url
}
%p
Please wait while we import the repository for you. Refresh at will.
:javascript
new
ProjectImport
();
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