aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorSaeed Rasooli <saeed.gnu@gmail.com>2018-03-05 16:42:58 +0800
committerSaeed Rasooli <saeed.gnu@gmail.com>2018-03-05 16:46:04 +0800
commitd0fcd7136a31f3f693cb63e6e2733435e4240258 (patch)
tree3c06ab44e9eaeb3f92a4759dffef9ba66fef90bb /repository.go
parent43fe6601682d13c5b05a1fc0850e5f294e636486 (diff)
downloadgo-git-d0fcd7136a31f3f693cb63e6e2733435e4240258.tar.gz
add LogOrder, LogOptions.Order, implement Order=LogOrderCommitterTime and Order=LogOrderBSF
Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/repository.go b/repository.go
index 24d025d..98558d9 100644
--- a/repository.go
+++ b/repository.go
@@ -728,7 +728,19 @@ func (r *Repository) Log(o *LogOptions) (object.CommitIter, error) {
return nil, err
}
- return object.NewCommitPreorderIter(commit, nil, nil), nil
+ switch o.Order {
+ case LogOrderDefault:
+ return object.NewCommitPreorderIter(commit, nil, nil), nil
+ case LogOrderDFS:
+ return object.NewCommitPreorderIter(commit, nil, nil), nil
+ case LogOrderDFSPost:
+ return object.NewCommitPostorderIter(commit, nil), nil
+ case LogOrderBSF:
+ return object.NewCommitIterBSF(commit, nil, nil), nil
+ case LogOrderCommitterTime:
+ return object.NewCommitIterCTime(commit, nil, nil), nil
+ }
+ return nil, fmt.Errorf("invalid Order=%v", o.Order)
}
// Tags returns all the References from Tags. This method returns all the tag