Skip to content

Commit

Permalink
add repo when return
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Oct 22, 2019
1 parent 0d36e27 commit 41ed770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2592,19 +2592,19 @@ func ForkRepository(doer, owner *User, oldRepo *Repository, name, desc string) (
sess2 := x.NewSession()
defer sess2.Close()
if err = sess2.Begin(); err != nil {
return nil, err
return repo, err
}

var lfsObjects []*LFSMetaObject
if err = sess2.Where("repository_id=?", oldRepo.ID).Find(&lfsObjects); err != nil {
return nil, err
return repo, err
}

for _, v := range lfsObjects {
v.ID = 0
v.RepositoryID = repo.ID
if _, err = sess2.Insert(v); err != nil {
return nil, err
return repo, err
}
}

Expand Down

0 comments on commit 41ed770

Please sign in to comment.