private static void setConfigKeyValueUnsafe(ConfigScope scope, string key, string value, string path) { string mode = value == null ? "unset" : ""; string scopeString = scope.ToString().ToLower(); string config = String.Format("config --{0} --{1} {2} {3}", scopeString, mode, key, value ?? ""); ExternalProcess.Start("git", config, true, path); }
public static IEnumerable <string> GetConfigKeyValue(ConfigScope scope, string key, string path = "") { try { string scopeString = scope.ToString().ToLower(); string config = String.Format("config --{0} {1}", scopeString, key); ExternalProcess.Result result = ExternalProcess.Start("git", config, true, path); return(result.StdOut); } catch (ExternalProcessException) { return(Array.Empty <string>()); } }