Ejemplo n.º 1
0
        /**
         * Parse all remote blocks in an existing configuration file, looking for
         * remotes configuration.
         *
         * @param rc
         *            the existing configuration to get the remote settings from.
         *            The configuration must already be loaded into memory.
         * @return all remotes configurations existing in provided repository
         *         configuration. Returned configurations are ordered
         *         lexicographically by names.
         * @throws URISyntaxException
         *             one of the URIs within the remote's configuration is invalid.
         */
        public static List<RemoteConfig> getAllRemoteConfigs(RepositoryConfig rc)
        {
            List<string> names = new List<string>(rc.GetSubsections(SECTION));
            names.Sort();

            List<RemoteConfig> result = new List<RemoteConfig>(names.Count);
            foreach (string name in names)
            {
                result.Add(new RemoteConfig(rc, name));
            }
            return result;
        }