Beispiel #1
0
        private static bool FetchGitRepo(ref List <string> fetchResult)
        {
            char[] delimiter = { '>', '\r', '\n' };
            bool   isError   = false;

            GitConfig.Arguments = _fetchCmd;

            GitProcess      newProcess   = new GitProcess(GitConfig);
            GitStreamReader stdFetchData = newProcess.RunProcess();

            foreach (var item in stdFetchData.StandardError)
            {
                if (item != null && item.Contains("->"))
                {
                    var splitLine = item.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
                    fetchResult.AddRange(splitLine.Where(o => o.Contains("origin")));
                }
                else if (item != null && item.Contains("fatal:"))
                {
                    var splitLine = item.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
                    fetchResult.AddRange(splitLine);
                    isError = true;
                }
            }

            return(isError);
        }
Beispiel #2
0
        public GitProcess(ProcessStartInfo Config)
        {
            StdData = new GitStreamReader();

            _gitProcess = new Process();

            _gitProcess.StartInfo = Config;
        }
Beispiel #3
0
        private static List <string> GetSubmodulesList()
        {
            var submoduleList = new List <string>();

            GitConfig.Arguments = _getSubmodulesCmd;

            GitProcess      newProcess    = new GitProcess(GitConfig);
            GitStreamReader getSubmodules = newProcess.RunProcess();

            foreach (var item in getSubmodules.StandardOutput)
            {
                if (item != null)
                {
                    var submodule = item.TrimStart().Split(null).Skip(1).FirstOrDefault();
                    if (!string.IsNullOrEmpty(submodule))
                    {
                        submoduleList.Add(submodule);
                    }
                }
            }

            return(submoduleList);
        }