Don't let sync git fail on ssh keys with no comment field (references:

issue 531 and issue 545)
This commit is contained in:
Thomas Keller 2010-10-07 11:56:52 +00:00
parent a29a2a0fa4
commit 806e69b858

View File

@ -80,7 +80,7 @@ class IDF_Key extends Pluf_Model
if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) { if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) {
return array('mtn', $m[1], $m[2]); return array('mtn', $m[1], $m[2]);
} }
else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)\s(\S+)$#', $this->content, $m)) { else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) {
return array('ssh', $m[2], $m[1]); return array('ssh', $m[2], $m[1]);
} }