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
« Skilletor/Error/Unsupported.pm ↑ Summary Skilletor/Role/Source.pm »
1 package Skilletor::GitEnv;
2 # ABSTRACT: The environment of every git run – without git's repository-local variables
3  
4 234 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 234 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 234 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 234 our $VERSION = '0.001';
10  
11 234 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 234 ▶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 234 );
20  
21 20403 ▶sub git_env {
Subroutine git_env: called CC=1 SCAR=0.0
Pod documented
22 20403 my ( %extra ) = @_;
23 20403 my %env = %ENV;
24 20403 delete @env{ +REPO_LOCAL_VARS };
25 20403 return { %env, GIT_TERMINAL_PROMPT => '0', %extra };
26 }
27  
28 234 1;
29  
30 __END__
« Skilletor/Error/Unsupported.pm ↑ Summary Skilletor/Role/Source.pm »