mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							d602ba564f
						
					
				
				
					commit
					cbfc7f52b9
				
			@@ -400,6 +400,11 @@ func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
 | 
				
			|||||||
		RemoteAddr:  remoteAddr,
 | 
							RemoteAddr:  remoteAddr,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 | 
							if models.IsErrRepoAlreadyExist(err) {
 | 
				
			||||||
 | 
								ctx.Error(409, "", "The repository with the same name already exists.")
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		err = util.URLSanitizedError(err, remoteAddr)
 | 
							err = util.URLSanitizedError(err, remoteAddr)
 | 
				
			||||||
		if repo != nil {
 | 
							if repo != nil {
 | 
				
			||||||
			if errDelete := models.DeleteRepository(ctx.User, ctxUser.ID, repo.ID); errDelete != nil {
 | 
								if errDelete := models.DeleteRepository(ctx.User, ctxUser.ID, repo.ID); errDelete != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -256,6 +256,11 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if models.IsErrRepoAlreadyExist(err) {
 | 
				
			||||||
 | 
							ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tplMigrate, &form)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// remoteAddr may contain credentials, so we sanitize it
 | 
						// remoteAddr may contain credentials, so we sanitize it
 | 
				
			||||||
	err = util.URLSanitizedError(err, remoteAddr)
 | 
						err = util.URLSanitizedError(err, remoteAddr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user