diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/MGA/Git.pm | 10 |
2 files changed, 7 insertions, 6 deletions
@@ -1,3 +1,6 @@ + +- use Git::Repository instead of Git module + Version 0.5 - soft_repo.gl: allow @mga-packagers to push to master and release/ diff --git a/lib/MGA/Git.pm b/lib/MGA/Git.pm index 99d71d4..6c8fc72 100644 --- a/lib/MGA/Git.pm +++ b/lib/MGA/Git.pm @@ -1,7 +1,7 @@ package MGA::Git; use strict; -use Git; +use Git::Repository; use YAML qw(LoadFile DumpFile); use Template; use File::Slurp; @@ -23,12 +23,10 @@ sub load_gitrepos_dir { $dir =~ s/\.git$//; $infos->{include_dir} = "$config->{repodef_dir}/$dir"; if (-d $infos->{include_dir}) { - my $repo = Git->repository(Directory => $infos->{include_dir}); - $repo->command('pull'); + my $repo = Git::Repository->new(work_tree => $infos->{include_dir}); + $repo->run('pull'); } else { - Git::command('clone', $infos->{git_url}, $infos->{include_dir}); - my $repo = Git->repository(Directory => $infos->{include_dir}); - $repo->command('remote', 'add', 'origin', $infos->{git_url}); + Git::Repository->run(clone => $infos->{git_url}, $infos->{include_dir}); } } opendir(my $dh, $infos->{include_dir}) |