IsValidGitWorkingDir() 공개 메소드

Indicates whether the WorkingDir contains a git repository.
public IsValidGitWorkingDir ( ) : bool
리턴 bool
예제 #1
0
        public static IRepositoryHostPlugin TryGetGitHosterForModule(GitModule aModule)
        {
            if (!aModule.IsValidGitWorkingDir())
                return null;

            return GitHosters.FirstOrDefault(gitHoster => gitHoster.GitModuleIsRelevantToMe(aModule));
        }
예제 #2
0
        public CommitData GetOldCommitData(GitModule submodule)
        {
            if (submodule == null || !submodule.IsValidGitWorkingDir())
                return null;

            string error = "";
            return CommitData.GetCommitData(submodule, OldCommit, ref error);
        }
예제 #3
0
 private void BranchDropDown(object sender, EventArgs e)
 {
     GitModule module = new GitModule(Directory.Text);
     Branch.DisplayMember = "Name";
     IList<GitRef> heads;
     if (module.IsValidGitWorkingDir())
         heads = module.GetRefs(false);
     else
         heads = new List<GitRef>();
     heads.Insert(0, GitRef.NoHead(module));
     Branch.DataSource = heads;
 }
예제 #4
0
        private void ChangeWorkingDir(string path)
        {
            GitModule module = new GitModule(path);

            if (!module.IsValidGitWorkingDir())
            {
                DialogResult dialogResult = MessageBox.Show(this, directoryIsNotAValidRepository.Text,
                    directoryIsNotAValidRepositoryCaption.Text, MessageBoxButtons.YesNoCancel,
                    MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                if (dialogResult == DialogResult.Yes)
                {
                    Repositories.RepositoryHistory.RemoveRecentRepository(path);
                    return;
                }
                else if (dialogResult == DialogResult.Cancel)
                    return;
            }

            SetGitModule(module);
        }