private Dictionary <string, string> GetConfigurationOptions() { var rawAllOptions = _gitExecutor .GetString("config --get-regexp " + SectionName) .Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries); var options = new Dictionary <string, string>(); foreach (var option in rawAllOptions) { var optionKeyValue = option.Split(' '); if (optionKeyValue.Length != 2) { throw new ಠ_ಠ("Invalid config option: " + option); } var key = optionKeyValue[0] .Substring(optionKeyValue[0].IndexOf('.') + 1) .ToLowerInvariant(); options[key] = optionKeyValue[1]; } return(options); }
private string GetCacheDirectory() { var rawValue = _gitExecutor.GetString("rev-parse --git-dir"); if (string.IsNullOrEmpty(rawValue)) { throw new ಠ_ಠ("Error determining .git directory"); } return(Path.Combine(rawValue, DirectoryName)); }