lib/Skilletor/GitEnv.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Skilletor/Error/Target.pm ↑ Summary lib/Skilletor/Role/Source.pm »
1 package Skilletor::GitEnv;
2 # ABSTRACT: The environment of every git run – without git's repository-local variables
3  
4 674 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 674 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 674 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 674 our $VERSION = '0.008000';
10  
11 674 our @EXPORT_OK = qw( git_env REPO_LOCAL_VARS );
12  
13 # `git rev-parse --local-env-vars` of git 2.47.3, minus GIT_CONFIG_PARAMETERS and
14 # GIT_CONFIG_COUNT: the command-line config is the user's own and git keeps it for a submodule.
15 674 ▶use constant REPO_LOCAL_VARS => qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
16 GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_CONFIG GIT_OBJECT_DIRECTORY GIT_DIR GIT_WORK_TREE
17 GIT_IMPLICIT_WORK_TREE GIT_GRAFT_FILE GIT_INDEX_FILE GIT_NO_REPLACE_OBJECTS
18 GIT_REPLACE_REF_BASE GIT_PREFIX GIT_SHALLOW_FILE GIT_COMMON_DIR
19 674 );
20  
21 28247 ▶sub git_env {
Subroutine git_env: called CC=1 SCAR=0.0
Pod documented
22 28247 my ( %extra ) = @_;
23 28247 my %env = %ENV;
24 28247 delete @env{ +REPO_LOCAL_VARS };
25 28247 return { %env, GIT_TERMINAL_PROMPT => '0', %extra };
26 }
27  
28 674 1;
29  
30 __END__
« lib/Skilletor/Error/Target.pm ↑ Summary lib/Skilletor/Role/Source.pm »