Browse Source

Sujith :) ->
1. Removed unnused methods

sujith 1 month ago
parent
commit
63d7c20bbc

+ 1 - 46
Assets/Better Git/Arbitrator/Editor/Services/GitExecutors.cs

@@ -499,51 +499,6 @@ namespace Terra.Arbitrator.Services
             }
         }
         
-        public static async void ForcePullExecutor(Action<string> resolve, Action<Exception> reject)
-        {
-            var log = new StringBuilder();
-            var hasStashed = false;
-
-            try
-            {
-                using (var repo = new Repository(ProjectRoot))
-                {
-                    if (repo.RetrieveStatus().IsDirty)
-                    {
-                        await GitCommand.RunGitAsync(log, new[] { "stash", "push", "-u", "-m", "BetterGit-WIP-Pull" }, 0, 141);
-                        hasStashed = true;
-                    }
-                }
-                
-                await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" }, 0, 1, 141);
-
-                if (hasStashed)
-                {
-                    await GitCommand.RunGitAsync(log, new[] { "stash", "pop" }, 0, 1, 141);
-                    await GitCommand.RunGitAsync(log, new[] { "stash", "drop" }, 0, 141);
-                }
-                
-                resolve(log.ToString());
-            }
-            catch (Exception ex)
-            {
-                if (hasStashed)
-                {
-                    try
-                    {
-                        await GitCommand.RunGitAsync(new StringBuilder(), new[] { "stash", "pop" }, 0, 1, 141);
-                    }
-                    catch (Exception exception)
-                    {
-                        log.AppendLine($"Fatal Error trying to pop stash after a failed pull: {exception.Message}");
-                    }
-                }
-                log.AppendLine("\n--- PULL FAILED ---");
-                log.AppendLine(ex.ToString());
-                reject(new Exception(log.ToString()));
-            }
-        }
-        
         public static async void PullAndOverwriteExecutor(Action<string> resolve, Action<Exception> reject, List<GitChange> resolutions)
         {
             var tempFiles = new Dictionary<string, string>();
@@ -567,7 +522,7 @@ namespace Terra.Arbitrator.Services
                     }
                 }
 
-                await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" });
+                await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" }, 0, 1, 141);
 
                 foreach (var entry in tempFiles)
                 {

+ 0 - 8
Assets/Better Git/Arbitrator/Editor/Services/GitService.cs

@@ -110,14 +110,6 @@ namespace Terra.Arbitrator.Services
             return new Promise<string>(GitExecutors.SafePullExecutor);
         }
 
-        /// <summary>
-        /// Performs a pull that may result in merge conflicts.
-        /// </summary>
-        public static IPromise<string> ForcePull()
-        {
-            return new Promise<string>(GitExecutors.ForcePullExecutor);
-        }
-
         /// <summary>
         /// Performs a pull operation, intelligently handling conflicts based on user choices.
         /// </summary>