mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 20:54:50 +01:00
fix rename failed when rewrite public keys (#7761)
This commit is contained in:
parent
2594693a46
commit
4328d8e8d7
1 changed files with 3 additions and 1 deletions
|
@ -685,12 +685,14 @@ func rewriteAllPublicKeys(e Engine) error {
|
|||
}
|
||||
_, err = t.WriteString(line + "\n")
|
||||
if err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
defer f.Close()
|
||||
f.Close()
|
||||
}
|
||||
|
||||
t.Close()
|
||||
return os.Rename(tmpPath, fPath)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue