getRemoteUrl method
Implementation
Future<Uri> getRemoteUrl({
required String gitDirpath,
required String remote,
Map<String, String>? environment,
bool includeParentEnvironment = true,
}) async {
final dir = checkDirectoryExists(gitDirpath, "gitDirpath");
final res = await runAsync(
["remote", "get-url", remote],
workingDirectory: dir.path,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
);
if (0 != res.exitCode) {
throw CliResultException(
exitCode: res.exitCode,
stderr: res.stderr,
message: "Failed to get the url for the remote '$remote' "
"int the git directory at '$gitDirpath'",
);
}
return Uri.parse(res.stdout.toString().trim());
}