Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Git tests #608

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions t/deploy/git.t
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ subtest 'deploy with submodules and ignored files' => sub {

# Git::Repository sets the "GIT_WORK_TREE" envvar, which makes most
# submodule commands fail, so we have to unset it.
_git_run( $git, submodule => add => "file://$submoduledir",
_git_run( $git, qw( -c protocol.file.allow=always ),
submodule => add => "file://$submoduledir",
{ env => { GIT_WORK_TREE => undef } }
);
_git_run( $git, commit => '-m' => 'add submodule' );
Expand Down Expand Up @@ -390,7 +391,16 @@ done_testing;
sub make_git {
my ( $dir, %args ) = @_;

Git::Repository->run( "init", ( $args{bare} ? ( '--bare' ) : () ), '-b', 'master', "$dir" );
my $git_version = Statocles::Deploy::Git->_git_version;

my @options;
if ($args{bare}) {
push @options, '--bare';
}
if ($git_version >= 2.028000) {
push @options, '-b', 'master';
}
Git::Repository->run( "init", @options, "$dir" );

my $git = Git::Repository->new( work_tree => "$dir" );

Expand Down