From 77a8f2bfbd2b19d6e19edeb7a9276bc9fe576c00 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Tue, 7 Feb 2017 17:45:27 +0100 Subject: doc: improve godoc for WalkCommitHistory. --- plumbing/object/commit_walker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plumbing/object') 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), -- cgit