public override void OnSelect(List <string> paths)
 {
     GitCore.UnstagePaths(paths, (output) =>
     {
         GitEvents.TriggerOnLocalChange();
     });
 }
Example #2
0
        private void RenderUnstageButtons()
        {
            bool noneSelected = (stagedFileViewer.GetSelectedPaths().Count == 0);
            bool noFiles      = (stagedFiles.Count == 0);

            EditorGUILayout.BeginHorizontal();

            //UNSTAGE SELECTED
            EditorGUI.BeginDisabledGroup(noneSelected);

            if (GUILayout.Button("Unstage Selected", GUILayout.ExpandWidth(false)))
            {
                GitCore.UnstagePaths(stagedFileViewer.GetSelectedPaths(), null);
                Scan();
            }

            EditorGUI.EndDisabledGroup();

            //UNSTAGE ALL
            EditorGUI.BeginDisabledGroup(noFiles);

            if (GUILayout.Button("Unstage All", GUILayout.ExpandWidth(false)))
            {
                GitCore.UnstagePaths(GitFile.GetPaths(stagedFiles), null);
                Scan();
            }

            EditorGUI.EndDisabledGroup();

            EditorGUILayout.EndHorizontal();
        }
 //Function run when file context option is clicked
 public override void OnSelect(List <string> paths)
 {
     //Mkae sure all paths are not staged
     GitCore.UnstagePaths(paths, (unstageUutput) =>
     {
         //Discard files
         GitCore.DiscardFiles(paths, (discardOutput) =>
         {
             //Refresh
             GitEvents.TriggerOnLocalChange();
             AssetDatabase.Refresh(ImportAssetOptions.Default);
         });
     });
 }