Skip to content

Commit

Permalink
Split out test git user configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ferki committed Jan 18, 2025
1 parent 1bad3b9 commit dcf4a86
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions t/scm/git.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ else {
plan skip_all => 'Can not find git command';
}

my $git_user_name = 'Rex';
my $git_user_email = '[email protected]';

my $git_environment = {
GIT_CONFIG_GLOBAL => File::Spec->devnull(),
GIT_CONFIG_SYSTEM => File::Spec->devnull(),
GIT_CONFIG_GLOBAL => File::Spec->devnull(),
GIT_CONFIG_SYSTEM => File::Spec->devnull(),
GIT_AUTHOR_NAME => $git_user_name,
GIT_AUTHOR_EMAIL => $git_user_email,
GIT_COMMITTER_NAME => $git_user_name,
GIT_COMMITTER_EMAIL => $git_user_email,
};

ok( $git, "Found git command at $git" );
Expand Down Expand Up @@ -83,11 +90,6 @@ sub prepare_test_repo {

i_run 'git init', cwd => $directory, env => $git_environment;

i_run 'git config user.name Rex', cwd => $directory, env => $git_environment;
i_run 'git config user.email [email protected]',
cwd => $directory,
env => $git_environment;

i_run 'git commit --allow-empty -m commit',
cwd => $directory,
env => $git_environment;
Expand Down

0 comments on commit dcf4a86

Please sign in to comment.