normalizePath method

String normalizePath(
  1. String path
)

Implementation

String normalizePath(String path) {
  if (!path.startsWith('/')) {
    path = path == '.' ? workTree : p.normalize(p.join(workTree, path));
  }
  if (!path.startsWith(workTree)) {
    throw PathSpecOutsideRepoException(pathSpec: path);
  }
  return path;
}