Git-Gitalist

 view release on metacpan or  search on metacpan

lib/Git/Gitalist/Repository.pm  view on Meta::CPAN

        chomp $description;
    };
    $description = "Unnamed repository, edit the .git/description file to set a description"
        if $description eq "Unnamed repository; edit this file 'description' to name the repository.";
    return $description;
}

method _build_owner {
    return 'system' if $^O =~ 'MSWin32';

    my ($gecos, $name) = map { decode(langinfo(CODESET()), $_) } (getpwuid $self->path->stat->uid)[6,0];
    $gecos =~ s/,+$//;
    return length($gecos) ? $gecos : $name;
}

method _build_last_change {
    my $last_change;
    my $output = $self->run_cmd(
        qw{ for-each-ref --format=%(committer)
            --sort=-committerdate --count=1 refs/heads
      });

t/02git_Repository.t  view on Meta::CPAN


BEGIN {
    # Mocking to allow testing regardless of the user's locale
    require I18N::Langinfo if $^O ne 'MSWin32';
    no warnings 'redefine';
    my $stub = sub {
        return "UTF-8" if $_[0] == I18N::Langinfo::CODESET();
    };
    set_prototype \&$stub, ($] <= 5.008009) ? '$' : '_';
    *I18N::Langinfo::langinfo = $stub;
    *CORE::GLOBAL::getpwuid = sub {
        wantarray
            ? ("test", "x", "1000", "1000", "", "", "T\x{c3}\x{a9}st", "/home/test", "/bin/bash")
            : "test";
    };
}

BEGIN { use_ok 'Git::Gitalist::Repository' }

dies_ok {
    my $proj = Git::Gitalist::Repository->new();



( run in 0.236 second using v1.01-cache-2.11-cpan-8d75d55dd25 )