| 1 | package Git::Raw::Reference; | ||
| 2 | 87 | $Git::Raw::Reference::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 | |||
| 6 | 87 | ▶ | use Git::Raw; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Git::Raw::Reference - Git reference class | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | version 0.90 | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | A L<Git::Raw::Reference> represents a Git reference. | ||
| 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 annotated_commit( ) | ||
| 26 | |||
| 27 | Create a L<Git::Raw::AnnotatedCommit> from the reference. | ||
| 28 | |||
| 29 | =head2 lookup( $name, $repo ) | ||
| 30 | |||
| 31 | Retrieve the reference with name C<$name> in C<$repo>. | ||
| 32 | |||
| 33 | =head2 create( $name, $repo, $object [, $force, $symbolic] ) | ||
| 34 | |||
| 35 | Creates and returns a new reference named C<$name> in C<$repo> pointing | ||
| 36 | to C<$object>. C<$object> can be a L<Git::Raw::Blob>, L<Git::Raw::Commit>, | ||
| 37 | or a L<Git::Raw::Tree> object. If C<$force> is a truthy value, any existing | ||
| 38 | reference is overwritten. If C<$force> is falsy (the default) and a reference | ||
| 39 | named C<$name> already exists, an error is thrown. If C<$symbolic> is a truthy | ||
| 40 | value, then a symbolic reference is created. If C<$symbolic> is falsy | ||
| 41 | (the default), then a direct reference is created. If C<$symbolic> is a truthy | ||
| 42 | value, then C<$object> can be a L<Git::Raw::Reference> or a string. | ||
| 43 | |||
| 44 | =head2 delete( ) | ||
| 45 | |||
| 46 | Delete the reference. The L<Git::Raw::Reference> object must not be accessed | ||
| 47 | afterwards. | ||
| 48 | |||
| 49 | =head2 name( ) | ||
| 50 | |||
| 51 | Retrieve the name of the reference. | ||
| 52 | |||
| 53 | =head2 shorthand( ) | ||
| 54 | |||
| 55 | Get the reference's short name. This will transform the reference name into a | ||
| 56 | "human-readable" version. If no shortname is appropriate, it will return the | ||
| 57 | full name. | ||
| 58 | |||
| 59 | =head2 type( ) | ||
| 60 | |||
| 61 | Retrieve the type of the reference. Can be either C<"direct"> or C<"symbolic">. | ||
| 62 | |||
| 63 | =head2 target( [$new_target] ) | ||
| 64 | |||
| 65 | Retrieve the target of the reference. If the C<$new_target> parameter of type | ||
| 66 | L<Git::Raw::Reference> is passed, the reference will be changed to point to it. | ||
| 67 | |||
| 68 | Note that updating the target will invalidate all existing handles to the | ||
| 69 | reference. | ||
| 70 | |||
| 71 | This function returns either an object (L<Git::Raw::Blob>, L<Git::Raw::Commit>, | ||
| 72 | L<Git::Raw::Tag> or L<Git::Raw::Tree>) for direct references, or another | ||
| 73 | reference for symbolic references. | ||
| 74 | |||
| 75 | =head2 peel( $type ) | ||
| 76 | |||
| 77 | Recursively peel the reference until an object of the specified C<$type> is | ||
| 78 | found. Valid values for C<$type> include: C<"commit">, C<"tree"> or C<"tag">. | ||
| 79 | |||
| 80 | =head2 reflog( ) | ||
| 81 | |||
| 82 | Retrieve the L<Git::Raw::Reflog> of the reference. Shortcut for | ||
| 83 | C<Git::Raw::Reflog-E<gt>open()>. | ||
| 84 | |||
| 85 | =cut | ||
| 86 | |||
| 87 | 3 | ▶ | sub reflog { return Git::Raw::Reflog -> open (shift); } |
|
Subroutine
reflog: called CC=1 SCAR=0.0
Pod
documented
| |||
| 88 | |||
| 89 | =head2 owner( ) | ||
| 90 | |||
| 91 | Retrieve the L<Git::Raw::Repository> owning the reference. | ||
| 92 | |||
| 93 | =head2 is_branch( ) | ||
| 94 | |||
| 95 | Check if the reference is a branch. | ||
| 96 | |||
| 97 | =head2 is_remote( ) | ||
| 98 | |||
| 99 | Check if the reference is remote. | ||
| 100 | |||
| 101 | =head2 is_tag( ) | ||
| 102 | |||
| 103 | Check if the reference lives in the C<refsE<sol>tags> namespace. | ||
| 104 | |||
| 105 | =head2 is_note( ) | ||
| 106 | |||
| 107 | Check if the reference lives in the C<refsE<sol>notes> namespace. | ||
| 108 | |||
| 109 | =head1 AUTHOR | ||
| 110 | |||
| 111 | Alessandro Ghedini <alexbio@cpan.org> | ||
| 112 | |||
| 113 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 114 | |||
| 115 | =head1 LICENSE AND COPYRIGHT | ||
| 116 | |||
| 117 | Copyright 2012 Alessandro Ghedini. | ||
| 118 | |||
| 119 | This program is free software; you can redistribute it and/or modify it | ||
| 120 | under the terms of either: the GNU General Public License as published | ||
| 121 | by the Free Software Foundation; or the Artistic License. | ||
| 122 | |||
| 123 | See http://dev.perl.org/licenses/ for more information. | ||
| 124 | |||
| 125 | =cut | ||
| 126 | |||
| 127 | 87 | 1; # End of Git::Raw::Reference | |