mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user