From 900691567e51bf95bb92d36951e2b7b79d2596cc Mon Sep 17 00:00:00 2001 From: Antonio Jesus Navarro Perez Date: Tue, 28 Feb 2017 15:09:15 +0100 Subject: improve git package documentation (fix #231) --- references.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'references.go') diff --git a/references.go b/references.go index fe1d12b..338e2b7 100644 --- a/references.go +++ b/references.go @@ -10,15 +10,18 @@ import ( "github.com/sergi/go-diff/diffmatchpatch" ) -// References returns a References for the file at "path", the commits are -// sorted in commit order. It stops searching a branch for a file upon reaching -// the commit were the file was created. +// References returns a slice of Commits for the file at "path", starting from +// the commit provided that contains the file from the provided path. The last +// commit into the returned slice is the commit where the file was created. +// If the provided commit does not contains the specified path, a nil slice is +// returned. The commits are sorted in commit order, newer to older. // // Caveats: +// // - Moves and copies are not currently supported. +// // - Cherry-picks are not detected unless there are no commits between them and -// therefore can appear repeated in the list. -// (see git path-id for hints on how to fix this). +// therefore can appear repeated in the list. (see git path-id for hints on how to fix this). func References(c *object.Commit, path string) ([]*object.Commit, error) { var result []*object.Commit seen := make(map[plumbing.Hash]struct{}, 0) -- cgit