summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/publickey.go6
-rw-r--r--modules/base/markdown.go1
2 files changed, 3 insertions, 4 deletions
diff --git a/models/publickey.go b/models/publickey.go
index 70da8057ce..400486eba7 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -386,9 +386,6 @@ func ListPublicKeys(uid int64) ([]*PublicKey, error) {
// rewriteAuthorizedKeys finds and deletes corresponding line in authorized_keys file.
func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error {
- sshOpLocker.Lock()
- defer sshOpLocker.Unlock()
-
fr, err := os.Open(p)
if err != nil {
return err
@@ -444,6 +441,9 @@ func UpdatePublicKey(key *PublicKey) error {
}
func deletePublicKey(e *xorm.Session, key *PublicKey) error {
+ sshOpLocker.Lock()
+ defer sshOpLocker.Unlock()
+
has, err := e.Get(key)
if err != nil {
return err
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index d06e1338e7..03f1287c1d 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -198,7 +198,6 @@ func RenderRawMarkdown(body []byte, urlPrefix string) []byte {
extensions |= blackfriday.EXTENSION_FENCED_CODE
extensions |= blackfriday.EXTENSION_AUTOLINK
extensions |= blackfriday.EXTENSION_STRIKETHROUGH
- extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK
extensions |= blackfriday.EXTENSION_SPACE_HEADERS
extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK