public BlobBasedConfig(Config @base, Commit commit, string path)
: base(@base)
{
ObjectId treeId = commit.TreeId;
Repository r = commit.Repository;
TreeWalk.TreeWalk tree = TreeWalk.TreeWalk.ForPath(r, path, treeId);
if (tree == null)
{
throw new FileNotFoundException("Entry not found by path: " + path);
}
ObjectId blobId = tree.getObjectId(0);
ObjectLoader loader = tree.Repository.OpenBlob(blobId);
if (loader == null)
{
throw new IOException("Blob not found: " + blobId + " for path: " + path);
}
fromText(RawParseUtils.decode(loader.Bytes));
}