| 1 | package Git::Raw::Tree::Builder; | ||
| 2 | 1 | $Git::Raw::Tree::Builder::VERSION = '0.90'; | |
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Git::Raw::Tree::Builder - Git tree builder class | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | version 0.90 | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | A L<Git::Raw::Tree::Builder> allows you to build Git tree objects. | ||
| 19 | |||
| 20 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 21 | (any change will be appropriately documented in the changelog). | ||
| 22 | |||
| 23 | =head1 METHODS | ||
| 24 | |||
| 25 | =head2 new( $repo, [$tree] ) | ||
| 26 | |||
| 27 | Creates a new tree builder that will build trees in C<$repo>. If C<$tree> is | ||
| 28 | passed, the contents of the tree builder are initialized from the contents of | ||
| 29 | C<$tree>. | ||
| 30 | |||
| 31 | =head2 clear( ) | ||
| 32 | |||
| 33 | Clears the tree builder of all entries. | ||
| 34 | |||
| 35 | =head2 entry_count( ) | ||
| 36 | |||
| 37 | Returns the number of entries contained in this tree builder. | ||
| 38 | |||
| 39 | =head2 get( $filename ) | ||
| 40 | |||
| 41 | Return a L<Git::Raw::TreeEntry> corresponding to C<$filename>. | ||
| 42 | Returns C<undef> if no such entry exists. | ||
| 43 | |||
| 44 | =head2 insert( $filename, $object, $mode ) | ||
| 45 | |||
| 46 | Adds (or updates) an entry in this tree builder. C<$object> | ||
| 47 | can be either a L<Git::Raw::Tree> or L<Git::Raw::Blob> object. | ||
| 48 | Returns a L<Git::Raw::Tree::Entry> object on success. | ||
| 49 | |||
| 50 | =head2 remove( $filename ) | ||
| 51 | |||
| 52 | Removes the entry associated with the filename C<$filename> from this tree | ||
| 53 | builder. | ||
| 54 | |||
| 55 | =head2 write( ) | ||
| 56 | |||
| 57 | Writes the tree object we've been building into the repository. | ||
| 58 | Returns a L<Git::Raw::Tree> object on success. | ||
| 59 | |||
| 60 | =head1 AUTHOR | ||
| 61 | |||
| 62 | Rob Hoelz <rob@hoelz.ro> | ||
| 63 | |||
| 64 | =head1 LICENSE AND COPYRIGHT | ||
| 65 | |||
| 66 | Copyright 2012 Alessandro Ghedini. | ||
| 67 | |||
| 68 | This program is free software; you can redistribute it and/or modify it | ||
| 69 | under the terms of either: the GNU General Public License as published | ||
| 70 | by the Free Software Foundation; or the Artistic License. | ||
| 71 | |||
| 72 | See http://dev.perl.org/licenses/ for more information. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 1 | 1; # End of Git::Raw::Tree::Builder | |