Esempio n. 1
0
        private static void SetStatus(ref string repoStatus, GitSSHRevisions Rev)
        {
            if (Rev.LocalHead.Equals(Rev.RemoteHead))
            {
                repoStatus = "Up-to-date";
            }

            else if (Rev.LocalHead.Equals(Rev.BaseHead))
            {
                repoStatus = "Pull-Requested";
            }

            else if (Rev.RemoteHead.Equals(Rev.BaseHead))
            {
                repoStatus = "Push-Changes";
            }

            else
            {
                repoStatus = "Diverged";
            }
        }
Esempio n. 2
0
        private static string ProcessGitRepo(ref List <string> fetchResult, string GitRepo)
        {
            string repoStatus = String.Empty;

            GitConfig.WorkingDirectory = GitRepo;

            bool isError = FetchGitRepo(ref fetchResult);

            if (isError == false)
            {
                GitSSHRevisions rev = GetSSHDiffernce();

                if (rev.LocalHead != null && rev.RemoteHead != null && rev.BaseHead != null)
                {
                    SetStatus(ref repoStatus, rev);
                }
            }
            else
            {
                repoStatus = "fatal: Connection Error!";
            }

            return(repoStatus);
        }