mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 16:01:32 +01:00 
			
		
		
		
	Enable switching to a different source branch when PR already exists (#7819)
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
This commit is contained in:
		
							parent
							
								
									8101d803e6
								
							
						
					
					
						commit
						8bfeb85f93
					
				| @ -292,6 +292,13 @@ func CompareDiff(ctx *context.Context) { | ||||
| 	} | ||||
| 
 | ||||
| 	if ctx.Data["PageIsComparePull"] == true { | ||||
| 		headBranches, err := headGitRepo.GetBranches() | ||||
| 		if err != nil { | ||||
| 			ctx.ServerError("GetBranches", err) | ||||
| 			return | ||||
| 		} | ||||
| 		ctx.Data["HeadBranches"] = headBranches | ||||
| 
 | ||||
| 		pr, err := models.GetUnmergedPullRequest(headRepo.ID, ctx.Repo.Repository.ID, headBranch, baseBranch) | ||||
| 		if err != nil { | ||||
| 			if !models.IsErrPullRequestNotExist(err) { | ||||
| @ -312,13 +319,6 @@ func CompareDiff(ctx *context.Context) { | ||||
| 				return | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		headBranches, err := headGitRepo.GetBranches() | ||||
| 		if err != nil { | ||||
| 			ctx.ServerError("GetBranches", err) | ||||
| 			return | ||||
| 		} | ||||
| 		ctx.Data["HeadBranches"] = headBranches | ||||
| 	} | ||||
| 	beforeCommitID := ctx.Data["BeforeCommitID"].(string) | ||||
| 	afterCommitID := ctx.Data["AfterCommitID"].(string) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user