isShallowClone function

Future<bool> isShallowClone({
  1. String? cwd,
})

Check if in a shallow clone.

Implementation

Future<bool> isShallowClone({String? cwd}) async {
  final gitDir = await getGitDir(cwd ?? Directory.current.path);
  if (gitDir == null) return false;
  return File(p.join(gitDir, 'shallow')).existsSync();
}