You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
The unit test t/01-repo.t calls $config -> str('init.defaultBranch', 'main');
which has the side-affect of updating the user's .gitconfig file.
The can be rectified by using the default value which has already been determined in the current code to restore the original value - or absence:
my $config = Git::Raw::Config -> default();
my $default = $config -> str('init.defaultBranch');
$config -> str('init.defaultBranch', 'main');
my $repo = Git::Raw::Repository -> init($native_path, 0);
if (defined $default) # <-- additional code from here to restore original setting
{
$config->str('init.defaultbranch', $default);
}
else
{
$config->delete('init.defaultbranch');
}
Even better would be to extend Git::Raw::Repository -> init to more fully emulate the git init command with support for the --initial-branch=<branch-name> option.
thanks
The text was updated successfully, but these errors were encountered:
Hi,
The unit test
t/01-repo.t
calls$config -> str('init.defaultBranch', 'main');
which has the side-affect of updating the user's .gitconfig file.
The can be rectified by using the default value which has already been determined in the current code to restore the original value - or absence:
Even better would be to extend
Git::Raw::Repository -> init
to more fully emulate thegit init
command with support for the--initial-branch=<branch-name>
option.thanks
The text was updated successfully, but these errors were encountered: