// check that is a valid path
Repository repository = cli.getGeogig().getRepository();
NodeRef.checkValidPath(pathFilter);
Optional<NodeRef> ref = repository.command(FindTreeChild.class).setIndex(true)
.setParent(repository.workingTree().getTree()).setChildPath(pathFilter)
.call();
checkParameter(ref.isPresent(), "pathspec '%s' did not match any tree", pathFilter);
checkParameter(ref.get().getType() == TYPE.TREE,
"pathspec '%s' did not resolve to a tree", pathFilter);