mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
add publickey & access
This commit is contained in:
parent
b1c5adc2f2
commit
ee9bcf4d9f
4 changed files with 87 additions and 15 deletions
|
@ -39,7 +39,7 @@ func IsRepositoryExist(user *User, reposName string) (bool, error) {
|
|||
func CreateRepository(user *User, reposName string) (*Repo, error) {
|
||||
p := filepath.Join(repoRootPath, user.Name)
|
||||
os.MkdirAll(p, os.ModePerm)
|
||||
f := filepath.Join(p, reposName)
|
||||
f := filepath.Join(p, reposName+".git")
|
||||
_, err := git.InitRepository(f, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -108,7 +108,7 @@ func DeleteRepository(user *User, reposName string) (err error) {
|
|||
session.Rollback()
|
||||
return err
|
||||
}
|
||||
if err = os.RemoveAll(filepath.Join(repoRootPath, user.Name, reposName)); err != nil {
|
||||
if err = os.RemoveAll(filepath.Join(repoRootPath, user.Name, reposName+".git")); err != nil {
|
||||
// TODO: log and delete manully
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue