diff options
| -rwxr-xr-x | ropeylog | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -139,7 +139,7 @@ sub read_info_file { my $maint; my $email; - open my $f, "<$file" or die $!; + open my $f, "<$git_root/$file" or die $!; while(<$f>) { chomp; @@ -156,9 +156,7 @@ sub read_info_file { } sub parse_info_files { - my $olddir = getcwd(); - chdir($git_root) or die "$!"; - my $files = `git ls-files '*/*/*.info'`; + my $files = `git $git_args ls-files '*/*/*.info'`; for my $info (split /\n/, $files) { $total_builds++; my ($maintainer, $email) = read_info_file($info); @@ -172,15 +170,15 @@ sub parse_info_files { $lastgitdate{$maintainer} = $lastgithash{$maintainer} = 0; push @{$maintbuilds{$maintainer}}, $catbuild; } - chdir($olddir); @maintainers = keys %name2email; } sub get_git_maintainers { - my $olddir = getcwd(); - chdir($git_root) or die "$!"; - open my $in, "git log --pretty=format:%h%x09%an%x09%ae%x09%as%x09%s|" or die $!; + open my $in, "git $git_args log " . + "--pretty=format:%h%x09%an%x09%ae%x09%as%x09%s|" + or die $!; + while(<$in>) { chomp; my ($hash, $name, $email, $date, $catbuild, undef) = split /\t/, $_, 6; @@ -192,7 +190,6 @@ sub get_git_maintainers { } } close $in; - chdir($olddir); } ############### @@ -378,6 +375,8 @@ sub print_all_reports { $cache_dir = "$ENV{HOME}/.$SELF"; system("mkdir -p $cache_dir"); +$git_args = "--work-tree $git_root --git-dir $git_root/.git"; + if(@ARGV) { if($ARGV[0] eq '-d') { shift; |
