Exemple #1
0
        public bool TryGetConfigUrlMatch(string section, string repositoryUrl, out Dictionary <string, GitConfigSetting> configSettings)
        {
            Result result = this.InvokeGitAgainstDotGitFolder($"config --get-urlmatch {section} {repositoryUrl}");

            if (result.ExitCodeIsFailure)
            {
                configSettings = null;
                return(false);
            }

            configSettings = GitConfigHelper.ParseKeyValues(result.Output, ' ');
            return(true);
        }
Exemple #2
0
        public Result TryGetAllConfig(bool localOnly, out Dictionary <string, GitConfigSetting> configSettings)
        {
            configSettings = null;
            string       localParameter = localOnly ? "--local" : string.Empty;
            Result       result         = this.InvokeGitAgainstDotGitFolder("config --list " + localParameter);
            ConfigResult configResult   = new ConfigResult(result, "--list");

            if (configResult.TryParseAsString(out string output, out string _, string.Empty))
            {
                configSettings = GitConfigHelper.ParseKeyValues(output);
            }

            return(result);
        }