public static IRepositoryHostPlugin TryGetGitHosterForModule(GitModule aModule) { if (!aModule.IsValidGitWorkingDir()) return null; return GitHosters.FirstOrDefault(gitHoster => gitHoster.GitModuleIsRelevantToMe(aModule)); }
public CommitData GetOldCommitData(GitModule submodule) { if (submodule == null || !submodule.IsValidGitWorkingDir()) return null; string error = ""; return CommitData.GetCommitData(submodule, OldCommit, ref error); }
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; }
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); }