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
212967ae
Commit
212967ae
authored
Dec 20, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject blank environment vcariables in Gitlab::Git::RevList
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
c1dbae90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
lib/gitlab/git/rev_list.rb
lib/gitlab/git/rev_list.rb
+2
-2
spec/lib/gitlab/git/rev_list_spec.rb
spec/lib/gitlab/git/rev_list_spec.rb
+7
-0
No files found.
lib/gitlab/git/rev_list.rb
View file @
212967ae
...
@@ -22,7 +22,7 @@ module Gitlab
...
@@ -22,7 +22,7 @@ module Gitlab
def
valid?
def
valid?
environment_variables
.
all?
do
|
(
name
,
value
)
|
environment_variables
.
all?
do
|
(
name
,
value
)
|
value
.
start_with?
(
project
.
repository
.
path_to_repo
)
value
.
to_s
.
start_with?
(
project
.
repository
.
path_to_repo
)
end
end
end
end
...
@@ -35,7 +35,7 @@ module Gitlab
...
@@ -35,7 +35,7 @@ module Gitlab
end
end
def
environment_variables
def
environment_variables
@environment_variables
||=
env
.
slice
(
*
ALLOWED_VARIABLES
)
@environment_variables
||=
env
.
slice
(
*
ALLOWED_VARIABLES
)
.
compact
end
end
end
end
end
end
...
...
spec/lib/gitlab/git/rev_list_spec.rb
View file @
212967ae
...
@@ -26,6 +26,13 @@ describe Gitlab::Git::RevList, lib: true do
...
@@ -26,6 +26,13 @@ describe Gitlab::Git::RevList, lib: true do
expect
(
rev_list
).
not_to
be_valid
expect
(
rev_list
).
not_to
be_valid
end
end
it
"ignores nil values"
do
env
=
{
var
=>
nil
}
rev_list
=
described_class
.
new
(
'oldrev'
,
'newrev'
,
project:
project
,
env:
env
)
expect
(
rev_list
).
to
be_valid
end
end
end
end
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