--- /dev/null
+package System::Introspector::Repositories::Git;
+use Moo;
+
+sub gather {
+ my ($self) = @_;
+ my $pipe = $self->_open_locate_git_config_pipe;
+ my %location;
+ while (defined( my $line = <$pipe> )) {
+ chomp $line;
+ next unless $line =~ m{^(.+)/\.git/config$};
+ my $base = $1;
+ $location{ $base } = $self->_gather_git_info($line);
+ }
+ return \%location;
+}
+
+sub _gather_git_info {
+ my ($self, $config) = @_;
+ return {
+ config_file => $config,
+ config => $self->_gather_git_config($config),
+ };
+}
+
+sub _gather_git_config {
+ my ($self, $config) = @_;
+ my $pipe = $self->_open_git_config_pipe($config);
+ my %config;
+ while (defined( my $line = <$pipe> )) {
+ chomp $line;
+ my ($name, $value) = split m{=}, $line, 2;
+ $config{ $name } = $value;
+ }
+ return \%config;
+}
+
+sub _open_git_config_pipe {
+ my ($self, $config) = @_;
+ my $command = "git config --file $config --list";
+ open my $pipe, '-|', $command
+ or die "Unable to open pipe to '$command': $!\n";
+ return $pipe;
+}
+
+sub _open_locate_git_config_pipe {
+ my ($self) = @_;
+ my $command = 'locate .git/config';
+ open my $pipe, '-|', $command
+ or die "Unable to open pipe to '$command': $!\n";
+ return $pipe;
+}
+
+1;