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
f9e06897
Commit
f9e06897
authored
May 06, 2019
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape arg used in regex
parent
9aa81c0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
qa/qa/git/repository.rb
qa/qa/git/repository.rb
+1
-1
qa/spec/git/repository_spec.rb
qa/spec/git/repository_spec.rb
+9
-0
No files found.
qa/qa/git/repository.rb
View file @
f9e06897
...
...
@@ -251,7 +251,7 @@ module QA
end
def
netrc_already_contains_content?
read_netrc_content
.
grep
(
/^
#{
netrc_content
}
$/
).
any?
read_netrc_content
.
grep
(
/^
#{
Regexp
.
escape
(
netrc_content
)
}
$/
).
any?
end
end
end
...
...
qa/spec/git/repository_spec.rb
View file @
f9e06897
...
...
@@ -116,6 +116,15 @@ describe QA::Git::Repository do
expect
(
File
.
read
(
File
.
join
(
tmp_netrc_dir
,
'.netrc'
)))
.
to
eq
(
"machine foo login user password foo
\n
"
)
end
it
'adds credentials with special characters'
do
password
=
%q(!"#$%&'()*+,-./:;<=>?)
repository
.
username
=
'user'
repository
.
password
=
password
expect
(
File
.
read
(
File
.
join
(
tmp_netrc_dir
,
'.netrc'
)))
.
to
eq
(
"machine foo login user password
#{
password
}
\n
"
)
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