StartProcessGit() public static method

Execute a Git command and return true if output is non-empty
public static StartProcessGit ( string commands, bool showAlert = true ) : Task
commands string Git command to be executed
showAlert bool Show an alert dialog when error output is non-empty
return Task
Beispiel #1
0
        /// <summary>
        /// Do we have any stashes available
        /// </summary>
        /// <remarks>Cached for 1m</remarks>
        /// <returns></returns>
        public bool HasStash()
        {
            if (_cache.Contains(CacheKeyEnum.HasStash.ToString()))
            {
                return(bool.Parse(_cache.Get(CacheKeyEnum.HasStash.ToString()).ToString()));
            }

            var hasStash = ProcessHelper.StartProcessGit(this, "stash list");

            _cache.Set(CacheKeyEnum.HasStash.ToString(), hasStash, DateTimeOffset.Now.AddMinutes(1));
            return(hasStash);
        }
Beispiel #2
0
 public static void GetStash() => HasStash = ProcessHelper.StartProcessGit("stash list");
Beispiel #3
0
 public static bool RemoteBranchExists(EnvHelper envHelper, string branch)
 {
     return(ProcessHelper.StartProcessGit(envHelper, $"show-ref refs/remotes/origin/{branch}"));
 }
Beispiel #4
0
 /// <summary>
 /// Do we have any stashes available
 /// </summary>
 /// <returns></returns>
 public static async Task <bool> HasStash()
 => await ProcessHelper.StartProcessGit("stash list");
Beispiel #5
0
 public static async Task <bool> RemoteBranchExists(string branch)
 {
     return(await ProcessHelper.StartProcessGit($"show-ref refs/remotes/origin/{branch}"));
 }