diff options
author | Santiago M. Mola <santi@mola.io> | 2017-02-07 17:45:27 +0100 |
---|---|---|
committer | Santiago M. Mola <santi@mola.io> | 2017-02-07 17:45:27 +0100 |
commit | 77a8f2bfbd2b19d6e19edeb7a9276bc9fe576c00 (patch) | |
tree | 48983fe49766f4bee38789dc056f219c9bd9e3e3 /plumbing | |
parent | 62666856d9f4b3150671eb1f215a7072c02c0bc6 (diff) | |
download | go-git-77a8f2bfbd2b19d6e19edeb7a9276bc9fe576c00.tar.gz |
doc: improve godoc for WalkCommitHistory.
Diffstat (limited to 'plumbing')
-rw-r--r-- | plumbing/object/commit_walker.go | 6 |
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), |