mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-08 00:03:28 +00: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")
|
_, err = t.WriteString(line + "\n")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
f.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defer f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.Close()
|
||||||
return os.Rename(tmpPath, fPath)
|
return os.Rename(tmpPath, fPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue