Example #1
0
        /// <summary>
        /// Конструктор по умолчанию
        /// </summary>
        /// <param name="prepareAction">Подготовительное действие</param>
        /// <param name="logMessage">Сообщение, которое будет записано в лог по окончании получения состояния</param>
        public FetchJob(Action <TInput> prepareAction = default, string logMessage = default)
        {
            Prepare = prepareAction ?? Prepare;

            TryProcess = () => Commands.Fetch(
                Repository,
                Remote.Name,
                RefSpecs.Select(spec => spec.Specification),
                FetchOptions,
                logMessage ?? string.Empty);
        }
Example #2
0
        public override void Execute()
        {
            if (Force)
            {
                List <RefSpec> orig = new List <RefSpec>(RefSpecs);
                RefSpecs.Clear();
                foreach (RefSpec spec in orig)
                {
                    RefSpecs.Add(spec.SetForce(true));
                }
            }

            List <Transport> transports = Transport.openAll(Repository._internal_repo, Remote);

            foreach (Transport transport in transports)
            {
                if (ReceivePack != null)
                {
                    transport.OptionReceivePack = ReceivePack;
                }
                transport.DryRun   = DryRun;
                transport.PushThin = Thin;

                URIish uri    = transport.Uri;
                var    toPush = transport.findRemoteRefUpdatesFor(RefSpecs);
                try
                {
                    Result = transport.push(ProgressMonitor, toPush);
                }
                finally
                {
                    transport.Dispose();
                }
                printPushResult(uri, Result);
            }
        }
Example #3
0
 public void AddTags()
 {
     RefSpecs.Add(Transport.REFSPEC_TAGS);
 }
Example #4
0
 public void AddAll()
 {
     RefSpecs.Add(Transport.REFSPEC_PUSH_ALL);
 }