| 1 | package Git::Raw::Tree; | ||
| 2 | 87 | $Git::Raw::Tree::VERSION = '0.90'; | |
| 3 | 87 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 87 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | use overload | ||
| 6 | 7 | ▶ | '""' => sub { return $_[0] -> id }, |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 7 | 87 | fallback => 1; | |
| 8 | |||
| 9 | 87 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Git::Raw::Tree - Git tree class | ||
| 14 | |||
| 15 | =head1 VERSION | ||
| 16 | |||
| 17 | version 0.90 | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | A L<Git::Raw::Tree> represents a Git tree. | ||
| 22 | |||
| 23 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 24 | (any change will be appropriately documented in the changelog). | ||
| 25 | |||
| 26 | =head1 METHODS | ||
| 27 | |||
| 28 | =head2 lookup( $repo, $id ) | ||
| 29 | |||
| 30 | Retrieve the tree corresponding to C<$id>. This function is pretty much the same | ||
| 31 | as C<$repo-E<gt>lookup($id)> except that it only returns trees. If the tree | ||
| 32 | doesn't exist, this function will return C<undef>. | ||
| 33 | |||
| 34 | =head2 owner( ) | ||
| 35 | |||
| 36 | Retrieve the L<Git::Raw::Repository> owning the tree. | ||
| 37 | |||
| 38 | =head2 id( ) | ||
| 39 | |||
| 40 | Retrieve the id of the tree, as a string. | ||
| 41 | |||
| 42 | =head2 entries( ) | ||
| 43 | |||
| 44 | Retrieve a list of L<Git::Raw::Tree::Entry> objects. | ||
| 45 | |||
| 46 | =head2 entry_byname( $name ) | ||
| 47 | |||
| 48 | Retrieve a L<Git::Raw::Tree::Entry> object by name. If the entry cannot be found, | ||
| 49 | this function will return C<undef>. | ||
| 50 | |||
| 51 | =head2 entry_bypath( $path ) | ||
| 52 | |||
| 53 | Retrieve a L<Git::Raw::Tree::Entry> object by path. If the entry cannot be found, | ||
| 54 | this function will return C<undef>. | ||
| 55 | |||
| 56 | =head2 merge( $ancestor, $theirs, [\%merge_opts] ) | ||
| 57 | |||
| 58 | Merge C<$theirs> into this tree. C<$ancestor> and C<$theirs> should be | ||
| 59 | L<Git::Raw::Tree> objects. See C<Git::Raw::Repository-E<gt>merge()> for valid | ||
| 60 | C<%merge_opts> values. Returns a L<Git::Raw::Index> object containing the | ||
| 61 | merge result. | ||
| 62 | |||
| 63 | =head2 diff( [\%diff_opts] ) | ||
| 64 | |||
| 65 | Compute the L<Git::Raw::Diff> between two trees. See | ||
| 66 | C<Git::Raw::Repository-E<gt>diff()> for valid C<%diff_opts> values. | ||
| 67 | |||
| 68 | =head2 is_tree( ) | ||
| 69 | |||
| 70 | Returns true. | ||
| 71 | |||
| 72 | =head2 is_blob( ) | ||
| 73 | |||
| 74 | Returns false. | ||
| 75 | |||
| 76 | =head1 AUTHOR | ||
| 77 | |||
| 78 | Alessandro Ghedini <alexbio@cpan.org> | ||
| 79 | |||
| 80 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 81 | |||
| 82 | =head1 LICENSE AND COPYRIGHT | ||
| 83 | |||
| 84 | Copyright 2012 Alessandro Ghedini. | ||
| 85 | |||
| 86 | This program is free software; you can redistribute it and/or modify it | ||
| 87 | under the terms of either: the GNU General Public License as published | ||
| 88 | by the Free Software Foundation; or the Artistic License. | ||
| 89 | |||
| 90 | See http://dev.perl.org/licenses/ for more information. | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | 87 | 1; # End of Git::Raw::Tree | |