mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix a bug on refactoring (#13373)
This commit is contained in:
		@@ -5,11 +5,10 @@
 | 
				
			|||||||
package repository
 | 
					package repository
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"path/filepath"
 | 
					 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/git"
 | 
						"code.gitea.io/gitea/modules/git"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// PushUpdateOptions defines the push update options
 | 
					// PushUpdateOptions defines the push update options
 | 
				
			||||||
@@ -105,7 +104,7 @@ func IsForcePush(opts *PushUpdateOptions) (bool, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	output, err := git.NewCommand("rev-list", "--max-count=1", opts.OldCommitID, "^"+opts.NewCommitID).
 | 
						output, err := git.NewCommand("rev-list", "--max-count=1", opts.OldCommitID, "^"+opts.NewCommitID).
 | 
				
			||||||
		RunInDir(filepath.Join(setting.RepoRootPath, opts.RepoUserName, opts.RepoName))
 | 
							RunInDir(models.RepoPath(opts.RepoUserName, opts.RepoName))
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return false, err
 | 
							return false, err
 | 
				
			||||||
	} else if len(output) > 0 {
 | 
						} else if len(output) > 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -138,7 +138,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
					isForce, err := repo_module.IsForcePush(opts)
 | 
										isForce, err := repo_module.IsForcePush(opts)
 | 
				
			||||||
					if err != nil {
 | 
										if err != nil {
 | 
				
			||||||
						log.Error("isForcePush %s/%s failed: %v", repo.ID, branch, err)
 | 
											log.Error("isForcePush %s:%s failed: %v", repo.FullName(), branch, err)
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if isForce {
 | 
										if isForce {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user