mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 00:02:20 -05:00 
			
		
		
		
	Add missing patch conflit pattern
This commit is contained in:
		
							parent
							
								
									995487e822
								
							
						
					
					
						commit
						a47baa1b7a
					
				@ -3,7 +3,7 @@ Gogs - Go Git Service [
 | 
			
		||||
 | 
			
		||||
##### Current version: 0.8.27
 | 
			
		||||
##### Current version: 0.8.28
 | 
			
		||||
 | 
			
		||||
| Web | UI  | Preview  |
 | 
			
		||||
|:-------------:|:-------:|:-------:|
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							@ -17,7 +17,7 @@ import (
 | 
			
		||||
	"github.com/gogits/gogs/modules/setting"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const APP_VER = "0.8.27.0202"
 | 
			
		||||
const APP_VER = "0.8.28.0203"
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
			
		||||
 | 
			
		||||
@ -256,6 +256,7 @@ var patchConflicts = []string{
 | 
			
		||||
	"patch does not apply",
 | 
			
		||||
	"already exists in working directory",
 | 
			
		||||
	"unrecognized input",
 | 
			
		||||
	"error:",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// testPatch checks if patch can be merged to base repository without conflit.
 | 
			
		||||
@ -279,7 +280,7 @@ func (pr *PullRequest) testPatch() (err error) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	log.Trace("PullRequest[%d].testPatch(patchPath): %s", pr.ID, patchPath)
 | 
			
		||||
	log.Trace("PullRequest[%d].testPatch (patchPath): %s", pr.ID, patchPath)
 | 
			
		||||
 | 
			
		||||
	if err := pr.BaseRepo.UpdateLocalCopy(); err != nil {
 | 
			
		||||
		return fmt.Errorf("UpdateLocalCopy: %v", err)
 | 
			
		||||
@ -287,7 +288,7 @@ func (pr *PullRequest) testPatch() (err error) {
 | 
			
		||||
 | 
			
		||||
	// Checkout base branch.
 | 
			
		||||
	_, stderr, err := process.ExecDir(-1, pr.BaseRepo.LocalCopyPath(),
 | 
			
		||||
		fmt.Sprintf("PullRequest.Merge(git checkout): %v", pr.BaseRepo.ID),
 | 
			
		||||
		fmt.Sprintf("PullRequest.Merge (git checkout): %v", pr.BaseRepo.ID),
 | 
			
		||||
		"git", "checkout", pr.BaseBranch)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return fmt.Errorf("git checkout: %s", stderr)
 | 
			
		||||
@ -295,12 +296,12 @@ func (pr *PullRequest) testPatch() (err error) {
 | 
			
		||||
 | 
			
		||||
	pr.Status = PULL_REQUEST_STATUS_CHECKING
 | 
			
		||||
	_, stderr, err = process.ExecDir(-1, pr.BaseRepo.LocalCopyPath(),
 | 
			
		||||
		fmt.Sprintf("testPatch(git apply --check): %d", pr.BaseRepo.ID),
 | 
			
		||||
		fmt.Sprintf("testPatch (git apply --check): %d", pr.BaseRepo.ID),
 | 
			
		||||
		"git", "apply", "--check", patchPath)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		for i := range patchConflicts {
 | 
			
		||||
			if strings.Contains(stderr, patchConflicts[i]) {
 | 
			
		||||
				log.Trace("PullRequest[%d].testPatch(apply): has conflit", pr.ID)
 | 
			
		||||
				log.Trace("PullRequest[%d].testPatch (apply): has conflit", pr.ID)
 | 
			
		||||
				fmt.Println(stderr)
 | 
			
		||||
				pr.Status = PULL_REQUEST_STATUS_CONFLICT
 | 
			
		||||
				return nil
 | 
			
		||||
 | 
			
		||||
@ -1 +1 @@
 | 
			
		||||
0.8.27.0202
 | 
			
		||||
0.8.28.0203
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user