summaryrefslogtreecommitdiffstats
path: root/models/publickey.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-16 05:53:06 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-16 05:53:06 -0400
commitc83657307e4ba5d414389c0e012ecf789053f763 (patch)
treee8d4fc61e9ee08e63713058d4808ce093b34213c /models/publickey.go
parentbcafba47e8c384a13315d998eb1ba17e9aaf16f9 (diff)
downloadgitea-c83657307e4ba5d414389c0e012ecf789053f763.tar.gz
gitea-c83657307e4ba5d414389c0e012ecf789053f763.zip
Fix delete SSH key in file
Diffstat (limited to 'models/publickey.go')
-rw-r--r--models/publickey.go2
1 files changed, 1 insertions, 1 deletions
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.