| 1 | package Git::Raw::Submodule; | ||
| 2 | 87 | $Git::Raw::Submodule::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::Submodule - Git submodule class | ||
| 11 | |||
| 12 | =head1 VERSION | ||
| 13 | |||
| 14 | version 0.90 | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | B<WARNING>: The API of this module is unstable and may change without warning | ||
| 19 | (any change will be appropriately documented in the changelog). | ||
| 20 | |||
| 21 | =head1 METHODS | ||
| 22 | |||
| 23 | =head2 foreach( $repo, \&callback ) | ||
| 24 | |||
| 25 | Iterate over all tracked submodules of a repository. Calls C<\&callback> for each submodule. | ||
| 26 | The callback receives a single argument, the name of the submodule. A non-zero return value | ||
| 27 | will terminate the loop. | ||
| 28 | |||
| 29 | =head2 lookup( $repo, $name ) | ||
| 30 | |||
| 31 | Lookup submodule information by name or path. Returns a L<Git::Raw::Submodule> object. | ||
| 32 | |||
| 33 | =head2 init( $overwrite ) | ||
| 34 | |||
| 35 | Just like "git submodule init", this copies information about the submodule into ".git/config". | ||
| 36 | |||
| 37 | =head2 open( ) | ||
| 38 | |||
| 39 | Open the repository for a submodule. Returns a L<Git::Raw::Repository> object. | ||
| 40 | |||
| 41 | =head2 update( $init, [\%update_opts] ) | ||
| 42 | |||
| 43 | Update a submodule. This will clone a missing submodule and checkout the subrepository | ||
| 44 | to the commit specified in the index of the containing repository. If the submodule repository | ||
| 45 | doesn't contain the target commit, then the submodule is fetched using the fetch options | ||
| 46 | supplied in C<\%update_opts>. If the submodule is not initialized, setting the C<$init> flag | ||
| 47 | to true will initialize the submodule before updating. Otherwise, this method will thrown an | ||
| 48 | exception if attempting to update an uninitialzed repository. | ||
| 49 | |||
| 50 | Valid fields for C<%update_opts> are: | ||
| 51 | |||
| 52 | =over 4 | ||
| 53 | |||
| 54 | =item * "checkout_opts" | ||
| 55 | |||
| 56 | See C<Git::Raw::Repository-E<gt>checkout()>. | ||
| 57 | |||
| 58 | =item * "fetch_opts" | ||
| 59 | |||
| 60 | See C<Git::Raw::Remote-E<gt>fetch()>. | ||
| 61 | |||
| 62 | =item * "allow_fetch" | ||
| 63 | |||
| 64 | Allow fetching from the submodule's default remote if the target commit isn't | ||
| 65 | found. Enabled by default. | ||
| 66 | |||
| 67 | =back | ||
| 68 | |||
| 69 | =head2 name( ) | ||
| 70 | |||
| 71 | Get the name of submodule. | ||
| 72 | |||
| 73 | =head2 path( ) | ||
| 74 | |||
| 75 | Get the path to the submodule. | ||
| 76 | |||
| 77 | =head2 url( ) | ||
| 78 | |||
| 79 | Get the URL of the submodule. | ||
| 80 | |||
| 81 | =head2 add_to_index( ) | ||
| 82 | |||
| 83 | Add current submodule HEAD commit to index of superproject. | ||
| 84 | |||
| 85 | =head2 sync( ) | ||
| 86 | |||
| 87 | Copy submodule remote info into submodule repo. | ||
| 88 | |||
| 89 | =head2 reload( ) | ||
| 90 | |||
| 91 | Reread submodule info from config, index, and HEAD. | ||
| 92 | |||
| 93 | =head1 AUTHOR | ||
| 94 | |||
| 95 | Jacques Germishuys <jacquesg@cpan.org> | ||
| 96 | |||
| 97 | =head1 LICENSE AND COPYRIGHT | ||
| 98 | |||
| 99 | Copyright 2019 Jacques Germishuys. | ||
| 100 | |||
| 101 | This program is free software; you can redistribute it and/or modify it | ||
| 102 | under the terms of either: the GNU General Public License as published | ||
| 103 | by the Free Software Foundation; or the Artistic License. | ||
| 104 | |||
| 105 | See http://dev.perl.org/licenses/ for more information. | ||
| 106 | |||
| 107 | =cut | ||
| 108 | |||
| 109 | 87 | 1; # End of Git::Raw::Submodule | |