public Repository(string path)
{
Ensure.ArgumentNotNullOrEmptyString(path, "path");
int res = NativeMethods.git_repository_open(out handle, PosixPathHelper.ToPosix(path));
Ensure.Success(res);
isBare = NativeMethods.git_repository_is_bare(handle);
if (!isBare)
{
index = new Index(this);
}
commits = new CommitCollection(this);
refs = new ReferenceCollection(this);
branches = new BranchCollection(this);
tags = new TagCollection(this);
info = new Lazy<RepositoryInformation>(() => new RepositoryInformation(this, isBare));
config = new Lazy<Configuration>(() => new Configuration(this));
remotes = new Lazy<RemoteCollection>(() => new RemoteCollection(this));
}