@@ -197,14 +197,15 @@ func newCommitStatus(sess *xorm.Session, opts NewCommitStatusOptions) error {
197
197
return fmt .Errorf ("newCommitStatus[nil, %s]: no repository specified" , opts .SHA )
198
198
}
199
199
opts .CommitStatus .RepoID = opts .Repo .ID
200
+ repoPath := opts .Repo .repoPath (sess )
200
201
201
202
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 )
203
204
}
204
205
205
- gitRepo , err := git .OpenRepository (opts . Repo . RepoPath () )
206
+ gitRepo , err := git .OpenRepository (repoPath )
206
207
if err != nil {
207
- return fmt .Errorf ("OpenRepository[%s]: %v" , opts . Repo . RepoPath () , err )
208
+ return fmt .Errorf ("OpenRepository[%s]: %v" , repoPath , err )
208
209
}
209
210
if _ , err := gitRepo .GetCommit (opts .SHA ); err != nil {
210
211
return fmt .Errorf ("GetCommit[%s]: %v" , opts .SHA , err )
@@ -219,19 +220,19 @@ func newCommitStatus(sess *xorm.Session, opts NewCommitStatusOptions) error {
219
220
has , err := sess .Desc ("index" ).Limit (1 ).Get (lastCommitStatus )
220
221
if err != nil {
221
222
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 )
223
224
}
224
225
if has {
225
- log .Debug ("newCommitStatus[%s, %s]: found" , opts . Repo . RepoPath () , opts .SHA )
226
+ log .Debug ("newCommitStatus[%s, %s]: found" , repoPath , opts .SHA )
226
227
nextIndex = lastCommitStatus .Index
227
228
}
228
229
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 )
230
231
231
232
// Insert new CommitStatus
232
233
if _ , err = sess .Insert (opts .CommitStatus ); err != nil {
233
234
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 )
235
236
}
236
237
237
238
return nil
0 commit comments