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
78379f66
Commit
78379f66
authored
Jun 28, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip trailing whitespace in relative submodule URL
parent
585e6aa5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+1
-0
changelogs/unreleased/dm-relative-submodule-url-trailing-whitespace.yml
...eleased/dm-relative-submodule-url-trailing-whitespace.yml
+4
-0
spec/helpers/submodule_helper_spec.rb
spec/helpers/submodule_helper_spec.rb
+5
-0
No files found.
app/helpers/submodule_helper.rb
View file @
78379f66
...
...
@@ -73,6 +73,7 @@ module SubmoduleHelper
end
def
relative_self_links
(
url
,
commit
)
url
.
rstrip!
# Map relative links to a namespace and project
# For example:
# ../bar.git -> same namespace, repo bar
...
...
changelogs/unreleased/dm-relative-submodule-url-trailing-whitespace.yml
0 → 100644
View file @
78379f66
---
title
:
Strip trailing whitespace in relative submodule URL
merge_request
:
author
:
spec/helpers/submodule_helper_spec.rb
View file @
78379f66
...
...
@@ -170,6 +170,11 @@ describe SubmoduleHelper do
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
end
it
'with trailing whitespace'
do
result
=
relative_self_links
(
'../test.git '
,
commit_id
)
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
end
it
'two levels down'
do
result
=
relative_self_links
(
'../../test.git'
,
commit_id
)
expect
(
result
).
to
eq
([
"/
#{
group
.
path
}
/test"
,
"/
#{
group
.
path
}
/test/tree/
#{
commit_id
}
"
])
...
...
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