From 17c86c47c49fbebc47db0fa0e094338c4218f78e Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Mon, 15 Jul 2013 20:17:25 +0200 Subject: Use Git::Repository instead of Git module Git module on Mageia 1 seems to have some problems to clone a repo. --- NEWS | 3 +++ lib/MGA/Git.pm | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 42dc82b..337a51a 100644 --- a/NEWS +++ b/NEWS @@ -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}) -- cgit v1.2.1