Skip to content

Commit a420bed

Browse files
authored
Fix a bug on refactoring (#13373)
1 parent 7cb22d6 commit a420bed

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

modules/repository/push.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
package repository
66

77
import (
8-
"path/filepath"
98
"strings"
109

10+
"code.gitea.io/gitea/models"
1111
"code.gitea.io/gitea/modules/git"
12-
"code.gitea.io/gitea/modules/setting"
1312
)
1413

1514
// PushUpdateOptions defines the push update options
@@ -105,7 +104,7 @@ func IsForcePush(opts *PushUpdateOptions) (bool, error) {
105104
}
106105

107106
output, err := git.NewCommand("rev-list", "--max-count=1", opts.OldCommitID, "^"+opts.NewCommitID).
108-
RunInDir(filepath.Join(setting.RepoRootPath, opts.RepoUserName, opts.RepoName))
107+
RunInDir(models.RepoPath(opts.RepoUserName, opts.RepoName))
109108
if err != nil {
110109
return false, err
111110
} else if len(output) > 0 {

services/repository/push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
138138

139139
isForce, err := repo_module.IsForcePush(opts)
140140
if err != nil {
141-
log.Error("isForcePush %s/%s failed: %v", repo.ID, branch, err)
141+
log.Error("isForcePush %s:%s failed: %v", repo.FullName(), branch, err)
142142
}
143143

144144
if isForce {

0 commit comments

Comments
 (0)