toPathSpec method

String toPathSpec(
  1. String path
)

Implementation

String toPathSpec(String path) {
  if (path.startsWith(workTree)) {
    return path.substring(workTree.length);
  }
  if (path.startsWith('/')) {
    throw PathSpecOutsideRepoException(pathSpec: path);
  }

  return path;
}