cloneRepository method

Future<void> cloneRepository(
  1. String gitUrl,
  2. String? ref,
  3. Directory cloneDir
)

Implementation

Future<void> cloneRepository(
    String gitUrl, String? ref, Directory cloneDir) async {
  await processHelper.executeCommand('git', ['clone', gitUrl, cloneDir.path],
      processMessage: "Cloning $gitUrl");
  if (ref != null) {
    await processHelper.executeCommand('git', ['checkout', ref],
        workingDirectory: cloneDir.path,
        processMessage: "Checking out ref: $ref");
  }
}