diff options
Diffstat (limited to 'repository.go')
-rw-r--r-- | repository.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/repository.go b/repository.go index 2251d6c..11269ef 100644 --- a/repository.go +++ b/repository.go @@ -1068,6 +1068,11 @@ func (r *Repository) Log(o *LogOptions) (object.CommitIter, error) { it = r.logWithFile(*o.FileName, it, o.All) } + if o.Since != nil || o.Until != nil { + limitOptions := object.LogLimitOptions{Since: o.Since, Until: o.Until} + it = r.logWithLimit(it, limitOptions) + } + return it, nil } @@ -1097,6 +1102,10 @@ func (*Repository) logWithFile(fileName string, commitIter object.CommitIter, ch return object.NewCommitFileIterFromIter(fileName, commitIter, checkParent) } +func (*Repository) logWithLimit(commitIter object.CommitIter, limitOptions object.LogLimitOptions) object.CommitIter { + return object.NewCommitLimitIterFromIter(commitIter, limitOptions) +} + func commitIterFunc(order LogOrder) func(c *object.Commit) object.CommitIter { switch order { case LogOrderDefault: |