private void Commit()
        {
            Signature signature = GitManager.Signature;

            try
            {
                if (!GitExternalManager.TakeCommit(commitMessage))
                {
                    GitManager.Repository.Commit(commitMessage, signature, signature, new CommitOptions()
                    {
                        AllowEmptyCommit = settings.emptyCommit, AmendPreviousCommit = settings.amendCommit, PrettifyMessage = settings.prettify
                    });
                    GitHistoryWindow.GetWindow(true);
                }
                GitManager.Update();
            }
            catch (Exception e)
            {
                Debug.LogException(e);
            }
            finally
            {
                GUI.FocusControl("");
                commitMessage = string.Empty;
            }
        }
Example #2
0
        protected void OnMergeComplete(MergeResult result, string mergeType)
        {
            switch (result.Status)
            {
            case MergeStatus.UpToDate:
                GitHistoryWindow.GetWindow(true).ShowNotification(new GUIContent(string.Format("Everything is Up to date. Nothing to {0}.", mergeType)));
                break;

            case MergeStatus.FastForward:
                GitHistoryWindow.GetWindow(true).ShowNotification(new GUIContent(mergeType + " Complete with Fast Forwarding."));
                break;

            case MergeStatus.NonFastForward:
                GitDiffWindow.GetWindow(true).ShowNotification(new GUIContent("Do a merge commit in order to push changes."));
                GitDiffWindow.GetWindow(false).commitMessage = GitManager.Repository.Info.Message;
                Debug.Log(mergeType + " Complete without Fast Forwarding.");
                break;

            case MergeStatus.Conflicts:
                GUIContent content = EditorGUIUtility.IconContent("console.warnicon");
                content.text = "There are merge conflicts!";
                GitDiffWindow.GetWindow(true).ShowNotification(content);
                GitDiffWindow.GetWindow(false).commitMessage = GitManager.Repository.Info.Message;
                break;
            }
            GitManager.Update();
            Debug.LogFormat("{0} Status: {1}", mergeType, result.Status);
        }
 private void OnWizardCreate()
 {
     try
     {
         using (var repository = new Repository(GitManager.RepoPath))
         {
             repository.Network.Push(repository.Branches[branchNames[selectedBranch]], pushOptions);
             GitManager.Update();
             var window = GitHistoryWindow.GetWindow(true);
             window.ShowNotification(new GUIContent("Push Complete"));
         }
     }
     catch (Exception e)
     {
         if (e is NonFastForwardException)
         {
             GUIContent content = EditorGUIUtility.IconContent("console.warnicon");
             content.text = "Could not push changes to remote. Merge changes with remote before pushing.";
             GetWindow <GitHistoryWindow>().ShowNotification(content);
         }
         Debug.LogException(e);
     }
     finally
     {
         EditorUtility.ClearProgressBar();
     }
 }
 private void OnWizardCreate()
 {
     try
     {
         GitManager.Repository.Network.Fetch(remotes[selectedRemote], fetchOptions);
         Debug.Log("Fetch Complete");
         var window = GitHistoryWindow.GetWindow(true);
         window.ShowNotification(new GUIContent("Fetch Complete"));
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     finally
     {
         EditorUtility.ClearProgressBar();
     }
 }
Example #5
0
 private void OnWizardCreate()
 {
     try
     {
         MergeResult result = GitManager.Repository.MergeFetchedRefs(GitManager.Signature, mergeOptions);
         GitHistoryWindow.GetWindow(true);
         OnMergeComplete(result, "Merge");
         GitManager.Update();
         AssetDatabase.Refresh();
     }
     catch (CheckoutConflictException e)
     {
         Debug.LogException(e);
     }
     finally
     {
         EditorUtility.ClearProgressBar();
     }
 }