Some small refactors (#36163)

This commit is contained in:
Lunny Xiao
2025-12-15 11:55:44 -08:00
committed by GitHub
parent 26602fd207
commit da087270ff
6 changed files with 11 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ func GetCompareInfo(ctx context.Context, baseRepo, headRepo *repo_model.Reposito
)
// We don't need a temporary remote for same repository.
if headGitRepo.Path != baseRepo.RepoPath() {
if baseRepo.ID != headRepo.ID {
// Add a temporary remote
tmpRemote = strconv.FormatInt(time.Now().UnixNano(), 10)
if err = gitrepo.GitRemoteAdd(ctx, headRepo, tmpRemote, baseRepo.RepoPath()); err != nil {