public RepositoryViewModel GetRepositoryInfo() { var type = _repositoryManager.GetRepositoryType(); return(new RepositoryViewModel { Branches = _repository.GetBranches() .ToLookup(b => b.Id) .ToDictionary(p => p.Key, p => p.Select(b => b.Name)), RepositoryType = type.ToString(), CloneUrl = type == RepositoryType.Git ? "http://localhost:52590/SampleRepo.git" : null }); }
public static void EnsureRepository(IRepositoryManager repositoryManager, RepositoryType expectedType) { RepositoryType currentType = repositoryManager.GetRepositoryType(); if (currentType == RepositoryType.None) { repositoryManager.CreateRepository(expectedType); } else if (currentType != expectedType) { throw new InvalidOperationException("Unexpected repository type: " + currentType); } }
public RepositoryType GetRepositoryType() { return(_repositoryManager.GetRepositoryType()); }
public ActionResult Index() { PopulateRepositoyTypes(); return(View(_repositoryManager.GetRepositoryType())); }