GetCurrentCheckout() public method

public GetCurrentCheckout ( ) : string
return string
Exemplo n.º 1
0
        private static GitRevision GetCurrentRevision(GitModule aModule, RevisionGrid RevisionGrid, List<GitRef> currentTags, List<GitRef> currentLocalBranches,
                                                      List<GitRef> currentRemoteBranches, List<GitRef> currentBranches,
                                                      GitRevision currentRevision)
        {
            if (currentRevision == null)
            {
                IList<GitRef> refs;

                if (RevisionGrid == null)
                {
                    string currentRevisionGuid = aModule.GetCurrentCheckout();
                    refs = aModule.GetRefs(true, true).Where(gitRef => gitRef.Guid == currentRevisionGuid).ToList();
                }
                else
                {
                    currentRevision = RevisionGrid.GetCurrentRevision();
                    refs = currentRevision.Refs;
                }

                foreach (GitRef gitRef in refs)
                {
                    if (gitRef.IsTag)
                        currentTags.Add(gitRef);
                    else if (gitRef.IsHead || gitRef.IsRemote)
                    {
                        currentBranches.Add(gitRef);
                        if (gitRef.IsRemote)
                            currentRemoteBranches.Add(gitRef);
                        else
                            currentLocalBranches.Add(gitRef);
                    }
                }
            }
            return currentRevision;
        }
Exemplo n.º 2
0
        private static GitRevision GetCurrentRevision(GitModule aModule, RevisionGrid RevisionGrid, List<GitHead> currentTags, List<GitHead> currentLocalBranches,
                                                      List<GitHead> currentRemoteBranches, List<GitHead> currentBranches,
                                                      GitRevision currentRevision, string option)
        {
            if (option.StartsWith("{c") && currentRevision == null)
            {
                IList<GitHead> heads;

                if (RevisionGrid == null)
                {
                    heads = new List<GitHead>();
                    string currentRevisionGuid = aModule.GetCurrentCheckout();
                    foreach (GitHead head in aModule.GetHeads(true, true))
                    {
                        if (head.Guid == currentRevisionGuid)
                            heads.Add(head);
                    }
                }
                else
                {
                    currentRevision = RevisionGrid.GetCurrentRevision();
                    heads = currentRevision.Heads;
                }

                foreach (GitHead head in heads)
                {
                    if (head.IsTag)
                        currentTags.Add(head);
                    else if (head.IsHead || head.IsRemote)
                    {
                        currentBranches.Add(head);
                        if (head.IsRemote)
                            currentRemoteBranches.Add(head);
                        else
                            currentLocalBranches.Add(head);
                    }
                }
            }
            return currentRevision;
        }