Skip to content

Commit d4d130b

Browse files
committed
Merge pull request progit#542 from jouve/cred_ro_helper
git-credential-read-only should match against username
2 parents c839655 + 522c8ce commit d4d130b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: book/07-git-tools/git-credential-read-only

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
File.readlines(path).each do |fileline| # <4>
2424
prot,user,pass,host = fileline.scan(/^(.*?):\/\/(.*?):(.*?)@(.*)$/).first
25-
if prot == known['protocol'] and host == known['host'] then
25+
if prot == known['protocol'] and host == known['host'] and user == known['username'] then
2626
puts "protocol=#{prot}"
2727
puts "host=#{host}"
2828
puts "username=#{user}"

0 commit comments

Comments
 (0)