Browse Source

Sujith :) ->
1. Pushing small fixes

sujith 1 month ago
parent
commit
62607ec2e5

+ 1 - 1
Assets/Better Git/Arbitrator/Editor/GUI/ArbitratorWindow.cs

@@ -131,7 +131,7 @@ namespace Terra.Arbitrator.GUI
                 
                 var originalColor = UnityEngine.GUI.backgroundColor;
                 UnityEngine.GUI.backgroundColor = new Color(1f, 0.5f, 0.5f, 0.8f);
-                if (GUILayout.Button(new GUIContent($"Reset Selected ({selectedCount})", EditorGUIUtility.IconContent("d_TreeEditor.Trash").image), EditorStyles.toolbarButton, GUILayout.Width(130)))
+                if (GUILayout.Button(new GUIContent($"Reset Selected ({selectedCount})", EditorGUIUtility.IconContent("d_TreeEditor.Trash").image), EditorStyles.toolbarButton, GUILayout.Width(200)))
                 {
                     EditorApplication.delayCall += _controller.ResetSelected;
                 }

+ 2 - 3
Assets/Better Git/Arbitrator/Editor/Services/GitCommand.cs

@@ -7,7 +7,6 @@ using System;
 using CliWrap;
 using System.IO;
 using System.Linq;
-using UnityEngine;
 using System.Text;
 using UnityEngine.Scripting;
 using System.Threading.Tasks;
@@ -23,7 +22,7 @@ namespace Terra.Arbitrator.Services
     internal static class GitCommand
     {
         private static string _projectRoot;
-        private static string ProjectRoot => _projectRoot ??= Directory.GetParent(Application.dataPath)?.FullName;
+        private static string ProjectRoot => _projectRoot ??= MainThreadDataCache.ProjectRoot;
 
         /// <summary>
         /// Runs a git command asynchronously.
@@ -33,7 +32,7 @@ namespace Terra.Arbitrator.Services
         /// <param name="progress">A delegate to report real-time standard error lines.</param>
         /// <param name="args">The arguments to pass to the git command.</param>
         /// <param name="acceptableExitCodes">A list of exit codes that should not be treated as errors.</param>
-        public static async Task RunAsync(string execPath, StringBuilder log, IProgress<string> progress, string[] args, params int[] acceptableExitCodes)
+        private static async Task RunAsync(string execPath, StringBuilder log, IProgress<string> progress, string[] args, params int[] acceptableExitCodes)
         {
             var stdOutBuffer = new StringBuilder();
             var stdErrBuffer = new StringBuilder();

+ 2 - 0
Assets/Better Git/Arbitrator/Editor/Services/GitExecutors.cs

@@ -216,6 +216,8 @@ namespace Terra.Arbitrator.Services
                     throw new Exception("Author email is missing. Please set your email address in Project Settings > Better Git.");
                 }
                 
+                await GitCommand.RunGitAsync(new StringBuilder(), new[] { "fetch" });
+                
                 using (var repo = new Repository(ProjectRoot))
                 {
                     var remote = repo.Network.Remotes["origin"];