]> source.dussan.org Git - gitea.git/commitdiff
Fix delete SSH key in file
authorUnknown <joe2010xtmf@163.com>
Sun, 16 Mar 2014 09:53:06 +0000 (05:53 -0400)
committerUnknown <joe2010xtmf@163.com>
Sun, 16 Mar 2014 09:53:06 +0000 (05:53 -0400)
models/publickey.go

index 3171e268f71b2c7f5e077439d58cf18c3bb248d7..6aed7c57418b900873b0e03952d2ee596ce189d2 100644 (file)
@@ -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.