diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-29 02:14:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 14:14:26 -0400 |
commit | a6450494c3a9c05667ae8a2ebdfdea55b8206e9b (patch) | |
tree | e4c6eba554eb4866337f82f2f96521b4b9370f84 /modules | |
parent | 572af214a7256fde76d0fa69fc5791b1758455ef (diff) | |
download | gitea-a6450494c3a9c05667ae8a2ebdfdea55b8206e9b.tar.gz gitea-a6450494c3a9c05667ae8a2ebdfdea55b8206e9b.zip |
Fix unclear `IsRepositoryExist` logic (#24374)
There was only one `IsRepositoryExist` function, it did: `has && isDir`
However it's not right, and it would cause 500 error when creating a new
repository if the dir exists.
Then, it was changed to `has || isDir`, it is still incorrect, it
affects the "adopt repo" logic.
To make the logic clear:
* IsRepositoryModelOrDirExist
* IsRepositoryModelExist
Diffstat (limited to 'modules')
-rw-r--r-- | modules/repository/create.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repository/create.go b/modules/repository/create.go index c1395242c5..e1f0bdcdf9 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -35,7 +35,7 @@ func CreateRepositoryByExample(ctx context.Context, doer, u *user_model.User, re return err } - has, err := repo_model.IsRepositoryExist(ctx, u, repo.Name) + has, err := repo_model.IsRepositoryModelExist(ctx, u, repo.Name) if err != nil { return fmt.Errorf("IsRepositoryExist: %w", err) } else if has { |