Exemplo n.º 1
0
        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
            });
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public RepositoryType GetRepositoryType()
 {
     return(_repositoryManager.GetRepositoryType());
 }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            PopulateRepositoyTypes();

            return(View(_repositoryManager.GetRepositoryType()));
        }