public override void OnSelect(List <string> paths) { GitCore.StagePaths(paths, (output) => { GitEvents.TriggerOnLocalChange(); }); }
/// <summary> /// Scans the status of the local repo, and renders it /// </summary> private void Scan() { //Scan status GitCore.Status(true, (commandOutput) => { //Error catch if (commandOutput.errorData != null) { Debug.LogError(commandOutput.errorData); error = true; errorString = commandOutput.errorData; return; } error = false; BuildStageLists(commandOutput.outputData); }); //Scan branch GitCore.CurrentBranch((branch) => { branchName = branch; }, (error) => { branchName = "Error"; }); }
//Run when button is clicked public override void OnClick(GitGudWindow window) { GitCore.Push(true, (output) => { GitEvents.TriggerOnLocalChange(); }); }
private void OnFinishStashWindow(string message) { GitCore.PushStash(message, (output) => { GitEvents.TriggerOnLocalChange(); }); }
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(); }
private void OnEnable() { GitCore.CurrentBranch((branch) => { currentBranchName = branch; Repaint(); }); }
public override void OnSelect(List <Commit> commits) { GitCore.CheckoutCommit(commits[0], (output) => { GitEvents.TriggerOnLocalChange(); AssetDatabase.Refresh(ImportAssetOptions.Default); }); }
public override void OnSelect(List <Commit> commits) { GitCore.CheckoutCommit(commits[0], (output) => { GitGud.RunCommands(new string[] { "clean -f -d", "reset --hard" }, (outputs) => { GitEvents.TriggerOnLocalChange(); AssetDatabase.Refresh(ImportAssetOptions.Default); }); }); }
public override void Refresh() { GitCore.Log("@{push}..", (output, commits) => { if (output.errorData != null) { return; } pushCount = commits.Count; }); }
private void ScanStashes() { GitCore.ListStash((output, stashes) => { if (output.errorData != null) { stashes = null; return; } this.stashes = stashes; }); }
private void ScanHistory() { GitCore.Log(null, (output, commits) => { if (output.errorData != null) { commits = null; return; } this.commits = commits; }); }
private void CreateBranch() { GitCore.CreateBranch(newBranchName, (output) => { if (output.errorData != null) { Debug.LogError("Could not create branch: " + output.errorData); } else { Debug.Log("Successfully create branch " + newBranchName); } }); }
//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); }); }); }
private void DiscardUnstaged() { bool discard = EditorUtility.DisplayDialog("Warning", "This will discard all unstaged changes - is this okay?", "Discard", "Cancel"); if (!discard) { return; } GitCore.DiscardAll((output) => { GitEvents.TriggerOnLocalChange(); AssetDatabase.Refresh(); }); }
private void AutoPush() { GitCore.Push(true, (output) => { //Trigger a refresh GitEvents.TriggerOnLocalChange(); //Error if (output.errorData != null) { Debug.LogError(output.errorData); return; } }); }
private void ScanHistory() { GitCore.Log(null, (output, commits) => { if (output.errorData != null) { commits = null; return; } this.commitsDict = commits; //Cache list form of dictionary this.commits = commitsDict.Values.ToList(); }); }
/// <summary> /// Scans the status of the local repo, and renders it /// </summary> private void Scan() { GitCore.Status(true, (commandOutput) => { //Error catch if (commandOutput.errorData != null) { Debug.LogError(commandOutput.errorData); error = true; errorString = commandOutput.errorData; return; } error = false; BuildStageLists(commandOutput.outputData); }); }
private void Commit() { //Commit! GitCore.Commit(commitText, (output) => { //Error if (output.errorData != null) { Debug.LogError(output.errorData); return; } //Auto push if (autoPush) { AutoPush(); } else { //Trigger a refresh GitEvents.TriggerOnLocalChange(); } }); }
public RepoController(GitCore gitCore) { this.gitCore = gitCore; }