removeRemote method

Future<GitRemoteConfig?> removeRemote(
  1. String name
)

Implementation

Future<GitRemoteConfig?> removeRemote(String name) async {
  var i = config.remotes.indexWhere((r) => r.name == name);
  if (i == -1) {
    return null;
  }

  var remote = config.remotes[i];
  config.remotes.removeAt(i);
  await saveConfig();

  await refStorage.removeReferences(refRemotePrefix + name);
  // TODO: Remote the objects from that remote?

  return remote;
}