mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fixes #6633 Signed-off-by: Segev Finer <segev@codeocean.com>
This commit is contained in:
		@@ -2432,6 +2432,7 @@ func ForkRepository(doer, u *User, oldRepo *Repository, name, desc string) (_ *R
 | 
				
			|||||||
		Description:   desc,
 | 
							Description:   desc,
 | 
				
			||||||
		DefaultBranch: oldRepo.DefaultBranch,
 | 
							DefaultBranch: oldRepo.DefaultBranch,
 | 
				
			||||||
		IsPrivate:     oldRepo.IsPrivate,
 | 
							IsPrivate:     oldRepo.IsPrivate,
 | 
				
			||||||
 | 
							IsEmpty:       oldRepo.IsEmpty,
 | 
				
			||||||
		IsFork:        true,
 | 
							IsFork:        true,
 | 
				
			||||||
		ForkID:        oldRepo.ID,
 | 
							ForkID:        oldRepo.ID,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -396,6 +396,13 @@ func RepoAssignment() macaron.Handler {
 | 
				
			|||||||
			ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID)
 | 
								ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.ID, repo.ID)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if repo.IsFork {
 | 
				
			||||||
 | 
								RetrieveBaseRepo(ctx, repo)
 | 
				
			||||||
 | 
								if ctx.Written() {
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// repo is empty and display enable
 | 
							// repo is empty and display enable
 | 
				
			||||||
		if ctx.Repo.Repository.IsEmpty {
 | 
							if ctx.Repo.Repository.IsEmpty {
 | 
				
			||||||
			ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
 | 
								ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
 | 
				
			||||||
@@ -423,13 +430,6 @@ func RepoAssignment() macaron.Handler {
 | 
				
			|||||||
		ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
							ctx.Data["BranchName"] = ctx.Repo.BranchName
 | 
				
			||||||
		ctx.Data["CommitID"] = ctx.Repo.CommitID
 | 
							ctx.Data["CommitID"] = ctx.Repo.CommitID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if repo.IsFork {
 | 
					 | 
				
			||||||
			RetrieveBaseRepo(ctx, repo)
 | 
					 | 
				
			||||||
			if ctx.Written() {
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		// People who have push access or have forked repository can propose a new pull request.
 | 
							// People who have push access or have forked repository can propose a new pull request.
 | 
				
			||||||
		if ctx.Repo.CanWrite(models.UnitTypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
 | 
							if ctx.Repo.CanWrite(models.UnitTypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {
 | 
				
			||||||
			// Pull request is allowed if this is a fork repository
 | 
								// Pull request is allowed if this is a fork repository
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user