From: Unknown Date: Sun, 16 Mar 2014 09:53:06 +0000 (-0400) Subject: Fix delete SSH key in file X-Git-Tag: v0.9.99~2426^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c83657307e4ba5d414389c0e012ecf789053f763;p=gitea.git Fix delete SSH key in file --- diff --git a/models/publickey.go b/models/publickey.go index 3171e268f7..6aed7c5741 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -134,7 +134,7 @@ func DeletePublicKey(key *PublicKey) (err error) { } // Found the line and copy rest of file. - if strings.Contains(line, key.Content) { + if strings.Contains(line, fmt.Sprintf("key-%d", key.Id)) && strings.Contains(line, key.Content) { continue } // Still finding the line, copy the line that currently read.