Skip to content

Commit 522c8ce

Browse files
committed
git-credential-read-only should match against username
1 parent c839655 commit 522c8ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/07-git-tools/git-credential-read-only

Lines changed: 1 addition & 1 deletion
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)