Ejemplo n.º 1
0
        public ITask UpdateGitAheadBehindStatus()
        {
            ConfigBranch?configBranch;
            ConfigRemote?configRemote;

            GetCurrentBranchAndRemote(out configBranch, out configRemote);

            var updateTask = new ActionTask <GitAheadBehindStatus>(token, (success, status) =>
            {
                if (success)
                {
                    GitAheadBehindStatusUpdated?.Invoke(status);
                }
            });

            if (configBranch.HasValue && configBranch.Value.Remote.HasValue)
            {
                var name         = configBranch.Value.Name;
                var trackingName = configBranch.Value.IsTracking ? configBranch.Value.Remote.Value.Name + "/" + configBranch.Value.TrackingBranch : "[None]";

                var task = GitClient.AheadBehindStatus(name, trackingName)
                           .Then(updateTask);
                return(HookupHandlers(task, false));
            }
            else
            {
                updateTask.PreviousResult = GitAheadBehindStatus.Default;
                return(updateTask);
            }
        }
Ejemplo n.º 2
0
        public void UpdateGitAheadBehindStatus()
        {
            ConfigBranch?configBranch;
            ConfigRemote?configRemote;

            GetCurrentBranchAndRemote(out configBranch, out configRemote);

            if (configBranch.HasValue && configBranch.Value.Remote.HasValue)
            {
                var name         = configBranch.Value.Name;
                var trackingName = configBranch.Value.IsTracking ? configBranch.Value.Remote.Value.Name + "/" + name : "[None]";

                var task = GitClient.AheadBehindStatus(name, trackingName)
                           .Then((success, status) =>
                {
                    if (success)
                    {
                        GitAheadBehindStatusUpdated?.Invoke(status);
                    }
                });
                task = HookupHandlers(task, false);
                task.Start();
            }
            else
            {
                GitAheadBehindStatusUpdated?.Invoke(GitAheadBehindStatus.Default);
            }
        }
Ejemplo n.º 3
0
 public void Reset()
 {
     IsBusy.Reset();
     IsNotBusy.Reset();
     CurrentBranchUpdated.Reset();
     GitAheadBehindStatusUpdated.Reset();
     GitStatusUpdated.Reset();
     GitLocksUpdated.Reset();
     GitLogUpdated.Reset();
     LocalBranchesUpdated.Reset();
     RemoteBranchesUpdated.Reset();
 }