Exemple #1
0
 private void PostprocessStage(string[] paths)
 {
     if (repository == null || !IsValidRepo)
     {
         return;
     }
     if (prefs.GetBool(UnityEditorGitPrefs.DisablePostprocess))
     {
         return;
     }
     string[] pathsFinal = paths.Where(a => !IsEmptyFolder(a)).SelectMany(GetPathWithMeta).ToArray();
     if (pathsFinal.Length > 0)
     {
         bool autoStage = gitSettings != null && gitSettings.AutoStage;
         if (Threading.IsFlagSet(GitSettingsJson.ThreadingType.Stage))
         {
             if (autoStage)
             {
                 AsyncStage(pathsFinal);
             }
             else
             {
                 MarkDirty(pathsFinal);
             }
         }
         else
         {
             if (autoStage)
             {
                 GitCommands.Stage(repository, pathsFinal);
             }
             MarkDirty(pathsFinal);
         }
     }
 }
Exemple #2
0
        private void Update(bool reloadRepository, string[] paths = null)
        {
            StartUpdating(paths);

            if (reloadRepository && IsValidRepo)
            {
                if (repository != null)
                {
                    repository.Dispose();
                }
                repository = new Repository(RepoPath);
                callbacks.IssueOnRepositoryLoad(repository);
            }

            if (repository != null)
            {
                if (!forceSingleThread && Threading.IsFlagSet(GitSettingsJson.ThreadingType.StatusList))
                {
                    RetreiveStatusThreaded(paths);
                }
                else
                {
                    RetreiveStatus(paths);
                }
            }
        }
Exemple #3
0
        private void Update(bool reloadRepository, string[] paths = null)
        {
            if (initializer.IsValidRepo)
            {
                StartUpdating(paths);

                if (reloadRepository || repository == null)
                {
                    if (repository != null)
                    {
                        repository.Dispose();
                    }
                    repository = CreateRepository(gitSettings.ActiveSubModule);
                    callbacks.IssueOnRepositoryLoad(repository);
                }

                if (!forceSingleThread && Threading.IsFlagSet(GitSettingsJson.ThreadingType.Status))
                {
                    RetreiveStatusThreaded(paths);
                }
                else
                {
                    RetreiveStatus(paths);
                }
            }
        }
Exemple #4
0
 public void AutoUnstage(string[] paths)
 {
     if (Threading.IsFlagSet(GitSettingsJson.ThreadingType.Unstage))
     {
         AsyncUnstage(paths);
     }
     else
     {
         GitCommands.Unstage(repository, paths);
         MarkDirty(paths);
     }
 }
Exemple #5
0
 public void AutoStage(params string[] localPaths)
 {
     if (Threading.IsFlagSet(GitSettingsJson.ThreadingType.Stage))
     {
         AsyncStage(localPaths);
     }
     else
     {
         GitCommands.Stage(repository, localPaths);
         MarkDirtyAuto(localPaths);
     }
 }
Exemple #6
0
 private void PostprocessUnstage(string[] paths)
 {
     if (repository == null || !IsValidRepo)
     {
         return;
     }
     if (prefs.GetBool(UnityEditorGitPrefs.DisablePostprocess))
     {
         return;
     }
     string[] pathsFinal = paths.SelectMany(GetPathWithMeta).ToArray();
     if (pathsFinal.Length > 0)
     {
         if (gitSettings != null && Threading.IsFlagSet(GitSettingsJson.ThreadingType.Unstage))
         {
             AsyncUnstage(pathsFinal);
         }
         else
         {
             GitCommands.Unstage(repository, pathsFinal);
             MarkDirty(pathsFinal);
         }
     }
 }