Exemplo n.º 1
0
 private static void RunStatusUpdateOnMainThread(GitStatus update)
 {
     new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update))
     {
         Affinity = TaskAffinity.UI
     }.Start();
 }
Exemplo n.º 2
0
 private void RepositoryManagerOnGitStatusUpdated(GitStatus gitStatus)
 {
     taskManager.RunInUI(() =>
     {
         cacheContainer.GitStatusEntriesCache.Entries = gitStatus.Entries;
         cacheContainer.GitTrackingStatusCache.Ahead  = gitStatus.Ahead;
         cacheContainer.GitTrackingStatusCache.Behind = gitStatus.Behind;
     });
 }
Exemplo n.º 3
0
 private void Prepare()
 {
     if (gitStatus.Entries == null)
     {
         gitStatus = new GitStatus
         {
             Entries = new List <GitStatusEntry>()
         };
     }
 }
Exemplo n.º 4
0
 public bool Equals(GitStatus other)
 {
     return
         (String.Equals(LocalBranch, other.LocalBranch) &&
          String.Equals(RemoteBranch, other.RemoteBranch) &&
          Ahead == other.Ahead &&
          Behind == other.Behind &&
          object.Equals(Entries, other.Entries)
         );
 }
Exemplo n.º 5
0
        private void ReturnStatus()
        {
            if (gitStatus.Entries == null)
            {
                return;
            }

            RaiseOnEntry(gitStatus);

            gitStatus = new GitStatus();
        }
Exemplo n.º 6
0
 private void RepositoryManagerOnGitStatusUpdated(GitStatus gitStatus)
 {
     new ActionTask(CancellationToken.None, () => {
         CurrentChanges = gitStatus.Entries;
         CurrentAhead   = gitStatus.Ahead;
         CurrentBehind  = gitStatus.Behind;
     })
     {
         Affinity = TaskAffinity.UI
     }.Start();
 }
Exemplo n.º 7
0
        private void OnStatusUpdate(GitStatus update)
        {
            if (update.Entries == null)
            {
                //Refresh();
                return;
            }

            // Set branch state
            currentBranch = update.LocalBranch;

            // (Re)build tree
            tree.UpdateEntries(update.Entries.Where(x => x.Status != GitFileStatus.Ignored).ToList());

            busy = false;
        }
Exemplo n.º 8
0
        private static void OnStatusUpdate(GitStatus update)
        {
            if (update.Entries == null)
            {
                return;
            }

            entries.Clear();
            entries.AddRange(update.Entries);

            guids.Clear();
            for (var index = 0; index < entries.Count; ++index)
            {
                var gitStatusEntry = entries[index];

                var path = gitStatusEntry.ProjectPath;
                if (gitStatusEntry.Status == GitFileStatus.Ignored)
                {
                    continue;
                }

                if (!path.StartsWith("Assets", StringComparison.CurrentCultureIgnoreCase))
                {
                    continue;
                }

                if (path.EndsWith(".meta", StringComparison.CurrentCultureIgnoreCase))
                {
                    continue;
                }

                var guid = AssetDatabase.AssetPathToGUID(path);
                guids.Add(guid);
            }

            EditorApplication.RepaintProjectWindow();
        }
Exemplo n.º 9
0
 private void UpdateStatus(GitStatus status)
 {
     currentRemote = Repository.CurrentRemote.HasValue ? Repository.CurrentRemote.Value.Name : null;
     statusAhead   = status.Ahead;
     statusBehind  = status.Behind;
 }
Exemplo n.º 10
0
 private void UpdateStatusOnMainThread(GitStatus status)
 {
     new ActionTask(TaskManager.Token, _ => UpdateStatus(status))
     .ScheduleUI(TaskManager);
 }
Exemplo n.º 11
0
 private void RepositoryManager_OnStatusUpdated(GitStatus status)
 {
     CurrentStatus = status;
     OnStatusUpdated?.Invoke(CurrentStatus);
 }
Exemplo n.º 12
0
 private void RunStatusUpdateOnMainThread(GitStatus status)
 {
     new ActionTask(TaskManager.Token, _ => OnStatusUpdate(status))
     .ScheduleUI(TaskManager);
 }
Exemplo n.º 13
0
 private void UpdateStatus(GitStatus status)
 {
     statusAhead  = status.Ahead;
     statusBehind = status.Behind;
 }
Exemplo n.º 14
0
 private void InternalInvoke(GitStatus status)
 {
     statusUpdated.SafeInvoke(status);
 }
Exemplo n.º 15
0
 private void RepositoryManager_OnRepositoryChanged(GitStatus status)
 {
     CurrentStatus = status;
     //Logger.Debug("Got STATUS 2 {0} {1}", OnRepositoryChanged, status);
     OnRepositoryChanged?.Invoke(CurrentStatus);
 }
Exemplo n.º 16
0
 public static IEnumerable <GitStatusEntry> GetEntriesExcludingIgnoredAndUntracked(this GitStatus gitStatus)
 {
     return(gitStatus.Entries.Where(entry => entry.Status != GitFileStatus.Ignored && !entry.Staged));
 }
Exemplo n.º 17
0
 private static void RunStatusUpdateOnMainThread(GitStatus update)
 {
     EntryPoint.ApplicationManager.TaskManager.ScheduleUI(new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update)));
 }