/// <summary>
        /// Reads in Git's configuration files, parses them, and combines them into a single database.
        /// <para/>
        /// Returns the combined database of configuration data.
        /// </summary>
        /// <param name="directory">Optional working directory of a repository from which to read its Git local configuration.</param>
        /// <param name="loadLocal">Read, parse, and include Git local configuration values if `<see langword="true"/>`; otherwise do not.</param>
        /// <param name="loadSystem">Read, parse, and include Git system configuration values if `<see langword="true"/>`; otherwise do not.</param>
        public static Configuration ReadConfiuration(string directory, bool loadLocal, bool loadSystem)
        {
            if (string.IsNullOrWhiteSpace(directory))
            {
                throw new ArgumentNullException("directory");
            }
            if (!Directory.Exists(directory))
            {
                throw new DirectoryNotFoundException(directory);
            }

            ConfigurationLevel types = ConfigurationLevel.All;

            if (!loadLocal)
            {
                types ^= ConfigurationLevel.Local;
            }

            if (!loadSystem)
            {
                types ^= ConfigurationLevel.System;
            }

            var config = new Configuration();

            config.LoadGitConfiguration(directory, types);

            return(config);
        }
        /// <summary>
        /// Reads in Git's configuration files, parses them, and combines them into a single database.
        /// <para/>
        /// Returns the combined database of configuration data.
        /// </summary>
        /// <param name="directory">Optional working directory of a repository from which to read its Git local configuration.</param>
        /// <param name="loadLocal">Read, parse, and include Git local configuration values if `<see langword="true"/>`; otherwise do not.</param>
        /// <param name="loadSystem">Read, parse, and include Git system configuration values if `<see langword="true"/>`; otherwise do not.</param>
        public static async Task <Configuration> ReadConfiuration(
            RuntimeContext context,
            string directory,
            bool loadLocal,
            bool loadSystem)
        {
            if (context is null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (directory is null)
            {
                throw new ArgumentNullException(nameof(directory));
            }
            if (!context.Storage.DirectoryExists(directory))
            {
                var inner = new DirectoryNotFoundException(directory);
                throw new ArgumentException(inner.Message, nameof(directory), inner);
            }

            ConfigurationLevel types = ConfigurationLevel.All;

            if (!loadLocal)
            {
                types ^= ConfigurationLevel.Local;
            }

            if (!loadSystem)
            {
                types ^= ConfigurationLevel.System;
            }

            var config = new Configuration(context);
            await config.LoadGitConfiguration(directory, types);

            return(config);
        }