diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-08 11:45:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 11:45:07 +0100 |
commit | b65d94e70ea1d013f43234522fa092168e4f1041 (patch) | |
tree | b36da73bd512d1b0ac52e4174ed8b7ed22c75b25 /plumbing/object/commit_walker.go | |
parent | 431af32445562b389397f3ee7af90bf61455fff1 (diff) | |
parent | 84b6bd8c22c8683479881a67db03dfdeeeb299ce (diff) | |
download | go-git-b65d94e70ea1d013f43234522fa092168e4f1041.tar.gz |
Merge pull request #259 from smola/docs
Improve documentation
Diffstat (limited to 'plumbing/object/commit_walker.go')
-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), |