mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Fix duplicate call of webhook (#7821)
This commit is contained in:
		
				
					committed by
					
						 Lauris BH
						Lauris BH
					
				
			
			
				
	
			
			
			
						parent
						
							8bfeb85f93
						
					
				
				
					commit
					e9bb75d8d1
				
			| @@ -396,32 +396,6 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	// Simulate push event. | ||||
| 	oldCommitID := opts.LastCommitID | ||||
| 	if opts.NewBranch != opts.OldBranch || oldCommitID == "" { | ||||
| 		oldCommitID = git.EmptySHA | ||||
| 	} | ||||
|  | ||||
| 	if err = repo.GetOwner(); err != nil { | ||||
| 		return nil, fmt.Errorf("GetOwner: %v", err) | ||||
| 	} | ||||
| 	err = PushUpdate( | ||||
| 		repo, | ||||
| 		opts.NewBranch, | ||||
| 		models.PushUpdateOptions{ | ||||
| 			PusherID:     doer.ID, | ||||
| 			PusherName:   doer.Name, | ||||
| 			RepoUserName: repo.Owner.Name, | ||||
| 			RepoName:     repo.Name, | ||||
| 			RefFullName:  git.BranchPrefix + opts.NewBranch, | ||||
| 			OldCommitID:  oldCommitID, | ||||
| 			NewCommitID:  commitHash, | ||||
| 		}, | ||||
| 	) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("PushUpdate: %v", err) | ||||
| 	} | ||||
|  | ||||
| 	commit, err = t.GetCommit(commitHash) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user