Skip to content

Commit

Permalink
fix(base.DatasetLog): fix limit and offset logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ramfox committed Apr 25, 2019
1 parent b8686c7 commit f7b042d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions base/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ func DatasetLog(r repo.Repo, ref repo.DatasetRef, limit, offset int, loadDataset
}
ref.Dataset = ds

offset--
if offset > 0 {
continue
}

rlog = append(rlog, ref)
if offset <= 0 {
rlog = append(rlog, ref)

limit--
if limit == 0 || ref.Dataset.PreviousPath == "" {
break
limit--
if limit == 0 || ref.Dataset.PreviousPath == "" {
break
}
}
ref.Path = ref.Dataset.PreviousPath
offset--
}

return rlog, nil
Expand Down

0 comments on commit f7b042d

Please sign in to comment.