From 695f1ba9f3bb423fef5a6836d9e3c15c86ba57d0 Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Thu, 31 May 2012 07:27:26 +1200 Subject: [PATCH] Improve documentation on Object::Commit --- CHANGES | 1 + lib/Git/PurePerl/Object/Commit.pm | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 70e0abf..7cabf59 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ Revision history for Perl module Git::PurePerl: + - Add basic documentation for Object::Commit (Kent Fredric) - Add has_ancestor_sha1 method to Object::Commit (Kent Fredric) - Add Git::PurePerl::Util with handy current_git_dir() util (Kent Fredric) diff --git a/lib/Git/PurePerl/Object/Commit.pm b/lib/Git/PurePerl/Object/Commit.pm index 983f8f6..5ff9291 100644 --- a/lib/Git/PurePerl/Object/Commit.pm +++ b/lib/Git/PurePerl/Object/Commit.pm @@ -63,6 +63,13 @@ sub BUILD { $self->comment( decode($encoding, join "\n", @lines) ); } +=head1 METHODS + +=head2 tree + +Returns the L<< C<::Tree>|Git::PurePerl::Object::Tree >> associated with this commit. + +=cut sub tree { my $self = shift; @@ -76,15 +83,33 @@ sub _push_parent_sha1 { push(@{$self->parent_sha1s}, $sha1); } +=head2 parent_sha1 + +Returns the C for the first parent of this this commit. + +=cut + sub parent_sha1 { return shift->parent_sha1s->[0]; } - + +=head2 parent + +Returns the L<< C<::Commit>|Git::PurePerl::Object::Commit >> for this commits first parent. + +=cut + sub parent { my $self = shift; return $self->git->get_object( $self->parent_sha1 ); } +=head2 parents + +Returns L<< C<::Commit>s|Git::PurePerl::Object::Commit >> for all this commits parents. + +=cut + sub parents { my $self = shift;