mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	In File Create/Update API return 404 if Branch does not exist (#11791)
This commit is contained in:
		@@ -350,6 +350,10 @@ func handleCreateOrUpdateFileError(ctx *context.APIContext, err error) {
 | 
				
			|||||||
		ctx.Error(http.StatusUnprocessableEntity, "Invalid", err)
 | 
							ctx.Error(http.StatusUnprocessableEntity, "Invalid", err)
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if models.IsErrBranchDoesNotExist(err) || git.IsErrBranchNotExist(err) {
 | 
				
			||||||
 | 
							ctx.Error(http.StatusNotFound, "BranchDoesNotExist", err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.Error(http.StatusInternalServerError, "UpdateFile", err)
 | 
						ctx.Error(http.StatusInternalServerError, "UpdateFile", err)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user