Ejemplo n.º 1
0
        public RemoteConfig(RepositoryConfig rc, string remoteName)
        {
            Name = remoteName;

            string[] vlst;
            string val;

            vlst = rc.GetStringList(SECTION, Name, KEY_URL);
            URIs = new List<URIish>(vlst.Length);
            foreach (string s in vlst)
                URIs.Add(new URIish(s));

            vlst = rc.GetStringList(SECTION, Name, KEY_FETCH);
            Fetch = new List<RefSpec>(vlst.Length);
            foreach (string s in vlst)
                Fetch.Add(new RefSpec(s));

            vlst = rc.GetStringList(SECTION, Name, KEY_PUSH);
            Push = new List<RefSpec>(vlst.Length);
            foreach (string s in vlst)
                Push.Add(new RefSpec(s));

            val = rc.GetString(SECTION, Name, KEY_UPLOADPACK) ?? DEFAULT_UPLOAD_PACK;
            UploadPack = val;

            val = rc.GetString(SECTION, Name, KEY_RECEIVEPACK) ?? DEFAULT_RECEIVE_PACK;
            ReceivePack = val;

            val = rc.GetString(SECTION, Name, KEY_TAGOPT);
            TagOpt = TagOpt.fromOption(val);
            Mirror = rc.GetBoolean(SECTION, Name, KEY_MIRROR, DEFAULT_MIRROR);
        }