Cogit::Util
version 0.001001
use Cogit::Util; use Cogit; my $repo = Cogit->new( gitdir => current_git_dir(), );
Determines if the given $dir has the basic requirements of a Git repository dir.
$dir
( ie: either a checkouts .git folder, or a bare repository )
.git
if ( is_git_dir( $dir ) ) { ... }
my $dir = find_git_dir( $subdir );
Finds the closest .git or bare tree that is either at $subdir or somewhere above $subdir
$subdir
If $subdir is inside a 'bare' repo, returns the path to that repo.
If $subdir is inside a checkout, returns the path to the checkouts .git dir.
If $subdir is not inside a git repo, returns a false value.
Finds the closest .git or bare tree by walking up parents.
my $git_dir = current_git_dir();
If $CWD is inside a bare repo somewhere, it will return the path to the bare repo root directory.
$CWD
If $CWD is inside a git checkout, it will return the path to the .git folder of that checkout.
If $CWD is not inside any recognisable git repo, will return a false value.
Arthur Axel "fREW" Schmidt <cogit@afoolishmanifesto.com>
This software is copyright (c) 2017 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Cogit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cogit
CPAN shell
perl -MCPAN -e shell install Cogit
For more information on module installation, please visit the detailed CPAN module installation guide.