Ejemplo n.º 1
0
        public IGitTfsRemote CreateTfsRemote(RemoteInfo remote)
        {
            foreach (var entry in _remoteConfigReader.Dump(remote))
            {
                if (entry.Value != null)
                {
                    _repository.Config.Set(entry.Key, entry.Value);
                }
                else
                {
                    _repository.Config.Unset(entry.Key);
                }
            }

            var gitTfsRemote = BuildRemote(remote);

            gitTfsRemote.EnsureTfsAuthenticated();

            return(_cachedRemotes[remote.Id] = gitTfsRemote);
        }
Ejemplo n.º 2
0
        public IGitTfsRemote CreateTfsRemote(RemoteInfo remote, string autocrlf = null, string ignorecase = null)
        {
            if (HasRemote(remote.Id))
            {
                throw new GitTfsException("A remote with id \"" + remote.Id + "\" already exists.");
            }

            // The autocrlf default (as indicated by a null) is false and is set to override the system-wide setting.
            // When creating branches we use the empty string to indicate that we do not want to set the value at all.
            if (autocrlf == null)
            {
                autocrlf = "false";
            }
            if (autocrlf != string.Empty)
            {
                _repository.Config.Set("core.autocrlf", autocrlf);
            }

            if (ignorecase != null)
            {
                _repository.Config.Set("core.ignorecase", ignorecase);
            }

            foreach (var entry in _remoteConfigReader.Dump(remote))
            {
                if (entry.Value != null)
                {
                    _repository.Config.Set(entry.Key, entry.Value);
                }
                else
                {
                    _repository.Config.Unset(entry.Key);
                }
            }

            var gitTfsRemote = BuildRemote(remote);

            gitTfsRemote.EnsureTfsAuthenticated();

            return(_cachedRemotes[remote.Id] = gitTfsRemote);
        }