Esempio n. 1
0
        public void CheckoutOnBranch(bool isMasterBranch, GitlabIssue issue = null)
        {
            if (isMasterBranch)
            {
                _gitRepository.CheckoutMaster();
                _gitRepository.PullOnRepository();
            }
            else
            {
                if (issue == null)
                {
                    return;
                }

                GitResult <Branch> result = _gitRepository.CheckoutIssueBranch(issue.Id.ToString());

                if (!result.HasSucceeded)
                {
                    return;
                }

                if (result.Response.TrackingDetails.AheadBy > 0)
                {
                    _gitRepository.PullOnRepository();
                }
            }
        }
Esempio n. 2
0
        public void CreateBranchLinkedWithIssue(GitlabIssue issue)
        {
            _gitRepository.CheckoutMaster();
            _gitRepository.PullOnRepository();
            GitResult <Branch> result = _gitRepository.CheckoutIssueBranch(issue.Id.ToString());

            if (result.HasSucceeded)
            {
                _gitRepository.PushOnOriginBranch(result.Response, false);
            }
        }