@@ -197,14 +197,15 @@ func newCommitStatus(sess *xorm.Session, opts NewCommitStatusOptions) error {
197197 return fmt .Errorf ("newCommitStatus[nil, %s]: no repository specified" , opts .SHA )
198198 }
199199 opts .CommitStatus .RepoID = opts .Repo .ID
200+ repoPath := opts .Repo .repoPath (sess )
200201
201202 if opts .Creator == nil {
202- return fmt .Errorf ("newCommitStatus[%s, %s]: no user specified" , opts . Repo . RepoPath () , opts .SHA )
203+ return fmt .Errorf ("newCommitStatus[%s, %s]: no user specified" , repoPath , opts .SHA )
203204 }
204205
205- gitRepo , err := git .OpenRepository (opts . Repo . RepoPath () )
206+ gitRepo , err := git .OpenRepository (repoPath )
206207 if err != nil {
207- return fmt .Errorf ("OpenRepository[%s]: %v" , opts . Repo . RepoPath () , err )
208+ return fmt .Errorf ("OpenRepository[%s]: %v" , repoPath , err )
208209 }
209210 if _ , err := gitRepo .GetCommit (opts .SHA ); err != nil {
210211 return fmt .Errorf ("GetCommit[%s]: %v" , opts .SHA , err )
@@ -219,19 +220,19 @@ func newCommitStatus(sess *xorm.Session, opts NewCommitStatusOptions) error {
219220 has , err := sess .Desc ("index" ).Limit (1 ).Get (lastCommitStatus )
220221 if err != nil {
221222 sess .Rollback ()
222- return fmt .Errorf ("newCommitStatus[%s, %s]: %v" , opts . Repo . RepoPath () , opts .SHA , err )
223+ return fmt .Errorf ("newCommitStatus[%s, %s]: %v" , repoPath , opts .SHA , err )
223224 }
224225 if has {
225- log .Debug ("newCommitStatus[%s, %s]: found" , opts . Repo . RepoPath () , opts .SHA )
226+ log .Debug ("newCommitStatus[%s, %s]: found" , repoPath , opts .SHA )
226227 nextIndex = lastCommitStatus .Index
227228 }
228229 opts .CommitStatus .Index = nextIndex + 1
229- log .Debug ("newCommitStatus[%s, %s]: %d" , opts . Repo . RepoPath () , opts .SHA , opts .CommitStatus .Index )
230+ log .Debug ("newCommitStatus[%s, %s]: %d" , repoPath , opts .SHA , opts .CommitStatus .Index )
230231
231232 // Insert new CommitStatus
232233 if _ , err = sess .Insert (opts .CommitStatus ); err != nil {
233234 sess .Rollback ()
234- return fmt .Errorf ("newCommitStatus[%s, %s]: %v" , opts . Repo . RepoPath () , opts .SHA , err )
235+ return fmt .Errorf ("newCommitStatus[%s, %s]: %v" , repoPath , opts .SHA , err )
235236 }
236237
237238 return nil
0 commit comments