### ----------------------------------------------------
### -- LibGit2
### -- Licenses: NASA-1.3
### -- Authors: Curt Tilmes <Curt.Tilmes@nasa.gov>
### -- File: t/29-open.t
### ----------------------------------------------------
use Test;
use File::Temp;
use LibGit2;

plan 9;

my $testdir = tempdir;

Git::Repository.init($testdir);

isa-ok my $repo = Git::Repository.open($testdir), Git::Repository, 'open';

is $repo.is-empty, True, 'is empty';

is $repo.is-bare, False, 'is not bare';

is $repo.is-shallow, False, 'is shallow';

isa-ok $repo = Git::Repository.open(~$testdir.IO.child('.git'), :bare),
    Git::Repository, 'open bare';

is $repo.is-bare, True, 'is bare';

my $subdir = $testdir.IO.child('a/b/c').mkdir;

isa-ok $repo = Git::Repository.open(~$subdir, :search),
    Git::Repository, 'open search';

is $repo.commondir, $testdir.IO.child('.git/'), 'correct git dir';

is $repo.item-path('index'), $testdir.IO.child('.git/index'), 'item-path';



