Inheritance: MonoBehaviour
Example #1
0
    public static void MergeBranch(string branchName)
    {
        Debug.Log(RunGitCmd("merge " + branchName));
        UnityGitHelper.CleanupUntracked();

        AssetDatabase.Refresh();
    }
Example #2
0
    public static void InitNewRepo()
    {
        string repoPath = GetRepoPath();

        if (repoPath == "")
        {
            repoPath = EditorUtility.OpenFolderPanel("Choose a repo directory", "", "");

            if (repoPath == "" || repoPath == null)
            {
                return;
            }

            repoPath = repoPath.Replace(@"\", "/");
            Debug.Log(repoPath);
        }
        else
        {
            Debug.Log("Repo already exists at: " + repoPath);
            return;
        }

        Debug.Log(RunGitCmd("init " + repoPath));
        UnityGitHelper.CreateUnityGitIgnores();
    }
Example #3
0
    void OnGUI()
    {
        if (!doCheckout)
        {
            bool  currentBranchSelected = false;
            Color defaultColor          = GUI.contentColor;

            selection = EditorGUILayout.Popup(selection, branches);

            if (branches[selection] == currentBranch)
            {
                currentBranchSelected = true;

                GUI.contentColor = Color.yellow;
                GUILayout.Label("You have the current branch selected...");
                GUI.contentColor = defaultColor;
            }
            else
            {
                GUILayout.Label("");
            }

            if (GUILayout.Button("Checkout Branch", GUILayout.MaxWidth(125)))
            {
                if (!currentBranchSelected)
                {
                    doCheckout = true;
                }
            }
        }
        else
        {
            GUILayout.Label("Are you sure you want to checkout?");
            GUILayout.Label("Any untracked files will be removed.");

            if (GUILayout.Button("Okay"))
            {
                GitSystem.CheckoutBranch(branches[selection]);
                Debug.Log("Current branch: " + GitSystem.GetCurrentBranch() + "\n");

                // TODO: Kill untracked Unity project files using unity's delete system
                UnityGitHelper.CleanupUntracked();

                Close();
            }
        }
    }
Example #4
0
    public static void CleanupUntracked()
    {
        Debug.Log(GitSystem.RunGitCmd("clean -d -f"));

        UnityGitHelper.CleanupUntracked(GitSystem.GetUntrackedFilesList(false));
    }
Example #5
0
 static void CleanupUntracked()
 {
     UnityGitHelper.CleanupUntracked();
 }
Example #6
0
 static void CreateIgnoreFiles()
 {
     UnityGitHelper.CreateUnityGitIgnores();
 }
Example #7
0
 static void CleanupUntrackedAndIgnored()
 {
     Debug.LogWarning("This feature partially implemented, it only cleared untracked, but not ignored files...");
     UnityGitHelper.CleanupUntracked();
 }