GitPlatform constructor

GitPlatform({
  1. required GitOperatingSystem operatingSystem,
  2. GitPathStyle? pathStyle,
  3. Map<String, String>? environment,
  4. String? currentDirectory,
})

Creates a platform of operatingSystem, with the pathStyle derived from it unless given, environment copied and made unmodifiable, and currentDirectory as the anchor relative paths hang from.

Implementation

GitPlatform({
  required this.operatingSystem,
  GitPathStyle? pathStyle,
  Map<String, String>? environment,
  String? currentDirectory,
})  : pathStyle = pathStyle ??
          (operatingSystem == GitOperatingSystem.windows
              ? GitPathStyle.windows
              : GitPathStyle.posix),
      environment = Map.unmodifiable(environment ?? const <String, String>{}),
      currentDirectory = currentDirectory;