sub is_git_repo {
my ($self, $dir) = @_;
- #FIXME: Only handles bare repos. Is that enough?
- return -f $dir->file('HEAD') or -f $dir->file('.git/HEAD');
+ return -f $dir->file('HEAD') || -f $dir->file('.git/HEAD');
}
sub project_info {
delete $props{description};
}
- #Carp::cluck "dir is: $dir";
$props{owner} = (getpwuid $dir->stat->uid)[6];
my $output = $self->run_cmd_in($dir, qw{
my $obj = $base->subdir($file);
next unless -d $obj;
next unless $self->is_git_repo($obj);
+ # XXX Leaky abstraction alert!
+ $obj = $obj->subdir('.git')
+ if -d $obj->subdir('.git');
push @ret, {
- name => ($obj->dir_list)[-1],
+ name => (File::Spec->splitdir($base->subdir($file)))[-1],
$self->get_project_properties($obj),
};
}
sub git_dir_from_project_name {
my ($self, $project) = @_;
- warn 'er, dir - '.dir(Gitalist->config->{repo_dir});
- warn 'er, subdir - '.dir(Gitalist->config->{repo_dir})->subdir($project);
return dir(Gitalist->config->{repo_dir})->subdir($project);
}