mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	* Fix 500 Error with branch and tag sharing the same name #15592 Fixed 500 error while create Pull request when there are more than one sources (branch, tag) with the same name Fix #15592 Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net> * fix logging Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -159,3 +159,20 @@ func (err *ErrPushRejected) GenerateMessage() {
 | 
			
		||||
	}
 | 
			
		||||
	err.Message = strings.TrimSpace(messageBuilder.String())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ErrMoreThanOne represents an error if pull request fails when there are more than one sources (branch, tag) with the same name
 | 
			
		||||
type ErrMoreThanOne struct {
 | 
			
		||||
	StdOut string
 | 
			
		||||
	StdErr string
 | 
			
		||||
	Err    error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsErrMoreThanOne checks if an error is a ErrMoreThanOne
 | 
			
		||||
func IsErrMoreThanOne(err error) bool {
 | 
			
		||||
	_, ok := err.(*ErrMoreThanOne)
 | 
			
		||||
	return ok
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (err *ErrMoreThanOne) Error() string {
 | 
			
		||||
	return fmt.Sprintf("ErrMoreThanOne Error: %v: %s\n%s", err.Err, err.StdErr, err.StdOut)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user