diff options
author | Antonio Navarro Perez <antnavper@gmail.com> | 2017-03-03 16:51:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-03 16:51:19 +0100 |
commit | 199317f082082fb8f168ad40a5cae134acfe4a16 (patch) | |
tree | 7a03fc0b2fd57416ae118f2692cb3b2df72304d8 /references.go | |
parent | 047a795df6d5a0d5dd0782297cea918e4a4a6e10 (diff) | |
parent | e408162066eddd16434adf1ec87aaa74aaff294a (diff) | |
download | go-git-199317f082082fb8f168ad40a5cae134acfe4a16.tar.gz |
Merge pull request #295 from ajnavarro/improvement/package-git-doc
improve git package documentation (fix #231)
Diffstat (limited to 'references.go')
-rw-r--r-- | references.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/references.go b/references.go index fe1d12b..68a54a6 100644 --- a/references.go +++ b/references.go @@ -10,15 +10,19 @@ 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) |