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

Checking out a tag doesn't work with Strawberry in a Github Workflow #110

Open
skirmess opened this issue Jul 24, 2021 · 3 comments
Open

Comments

@skirmess
Copy link

Checking out a tag with Git::Wrapper in a Github workflow with Strawberry Perl under Windows hangs forever. The same code works without an issue under Linux.

I've created a small repository with a Github workflow to demonstrate the problem:
https://github.com/skirmess/git-wrapper-bug-report

The test.sh script creates a test repository, creates a tag, then clones the repository and checks out the tag.

If you check the output of the Github workflow you'll see that 3 of 4 jobs worked, only the run that checks out the tag with Git::Wrapper on Strawberry didn't work:
https://github.com/skirmess/git-wrapper-bug-report/runs/3150607505?check_suite_focus=true

#!/usr/bin/perl

use 5.006;
use strict;
use warnings;

use Git::Wrapper;
use Path::Tiny;

print STDERR " ==> Create Git Test Repository\n";

my $repo_path = path('my_repo.git')->absolute;

mkdir $repo_path or die "Cannot create $repo_path";

{
    my $git = Git::Wrapper->new( $repo_path->stringify );
    $git->init;
    $git->config( 'user.email', 'test@example.com' );
    $git->config( 'user.name',  'Test' );

    my $file_A = $repo_path->child('A');
    my $file_B = $repo_path->child('B');
    $file_A->spew('5');
    $git->add('A');
    $git->commit( { message => 'initial commit' } );

    $file_A->spew('7');
    $git->add('A');
    $git->commit( { message => 'second commit' } );

    $git->branch('dev');
    $git->checkout('dev');

    $file_A->spew('11');
    $git->add('A');
    $file_B->spew('13');
    $git->add('B');
    $git->commit( { message => 'commit on dev branch' } );

    $git->checkout('master');

    $git->tag('my-tag');
}

print STDERR " ==> Clone\n";

my $ws = path('workspace');
$ws->mkpath;

print STDERR '  => Line: ', __LINE__, " \$git = Git::Wrapper->new\n";
my $git = Git::Wrapper->new( $ws->stringify );

print STDERR '  => Line: ', __LINE__, " \$git->clone\n";
$git->clone( $repo_path->stringify(), $ws->stringify );

exit 0 if @ARGV && $ARGV[0] eq '--setup-only';

print STDERR " ==> Checkout Tag\n";
print STDERR '  => Line: ', __LINE__, " \$git->checkout\n";
$git->checkout('my-tag');

print STDERR '  => Line: ', __LINE__, " checkout done\n";

# vim: ts=4 sts=4 sw=4 et: syntax=perl
@skirmess
Copy link
Author

I've added two new jobs that run on Strawberry and Ubuntu against the port-to-capture-tiny-52 branch, which fixes the problem.

https://github.com/skirmess/git-wrapper-bug-report/runs/3150854143?check_suite_focus=true

@skirmess
Copy link
Author

I've added two new jobs that run on Strawberry and Ubuntu against Git::Wrapper 0.048_090, which also fixes the problem.

https://github.com/skirmess/git-wrapper-bug-report/runs/3160421199?check_suite_focus=true

@genehack
Copy link
Owner

I'll look more closely at this this weekend; thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants