aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plumbing/object/commit_walker.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plumbing/object/commit_walker.go b/plumbing/object/commit_walker.go
index 1514cb3..8d70abe 100644
--- a/plumbing/object/commit_walker.go
+++ b/plumbing/object/commit_walker.go
@@ -13,7 +13,11 @@ type commitWalker struct {
cb func(*Commit) error
}
-// WalkCommitHistory walks the commit history
+// WalkCommitHistory walks the commit history, starting at the given commit and
+// visiting its parents in pre-order. The given callback will be called for each
+// visited commit. Each commit will be visited only once. If the callback returns
+// an error, walking will stop and will return the error. Other errors might be
+// returned if the history cannot be traversed (e.g. missing objects).
func WalkCommitHistory(c *Commit, cb func(*Commit) error) error {
w := &commitWalker{
seen: make(map[plumbing.Hash]bool),