#3181 detect situation when base branch is deleted in pull request
This commit is contained in:
		
							parent
							
								
									4f78abe7dc
								
							
						
					
					
						commit
						4b5e09e4d6
					
				
					 4 changed files with 11 additions and 3 deletions
				
			
		|  | @ -3,7 +3,7 @@ Gogs - Go Git Service [ | ||||
| 
 | ||||
| ##### Current tip version: 0.9.50 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | ||||
| ##### Current tip version: 0.9.51 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | ||||
| 
 | ||||
| | Web | UI  | Preview  | | ||||
| |:-------------:|:-------:|:-------:| | ||||
|  |  | |||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							|  | @ -17,7 +17,7 @@ import ( | |||
| 	"github.com/gogits/gogs/modules/setting" | ||||
| ) | ||||
| 
 | ||||
| const APP_VER = "0.9.50.0723" | ||||
| const APP_VER = "0.9.51.0723" | ||||
| 
 | ||||
| func init() { | ||||
| 	runtime.GOMAXPROCS(runtime.NumCPU()) | ||||
|  |  | |||
|  | @ -235,6 +235,14 @@ func PrepareViewPullInfo(ctx *context.Context, pull *models.Issue) *git.PullRequ | |||
| 	prInfo, err := headGitRepo.GetPullRequestInfo(models.RepoPath(repo.Owner.Name, repo.Name), | ||||
| 		pull.BaseBranch, pull.HeadBranch) | ||||
| 	if err != nil { | ||||
| 		if strings.Contains(err.Error(), "fatal: Not a valid object name") { | ||||
| 			ctx.Data["IsPullReuqestBroken"] = true | ||||
| 			ctx.Data["BaseTarget"] = "deleted" | ||||
| 			ctx.Data["NumCommits"] = 0 | ||||
| 			ctx.Data["NumFiles"] = 0 | ||||
| 			return nil | ||||
| 		} | ||||
| 
 | ||||
| 		ctx.Handle(500, "GetPullRequestInfo", err) | ||||
| 		return nil | ||||
| 	} | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| 0.9.50.0723 | ||||
| 0.9.51.0723 | ||||
		Loading…
	
		Reference in a new issue