Example #1
0
        internal void AddRemoteToLocalGitRepo(Site website)
        {
            // Get remote repos
            IList <string> remoteRepositories = GitClass.GetRemoteRepositories();
            string         repositoryUri      = website.GetProperty("RepositoryUri");
            string         uri = GitClass.GetUri(
                repositoryUri,
                website.RepositorySiteName,
                PublishingUsername);

            string remoteName;

            if (string.IsNullOrEmpty(Slot))
            {
                remoteName = "azure";
            }
            else
            {
                remoteName = "azure-" + Slot;
            }

            foreach (string name in remoteRepositories)
            {
                if (name.Equals(remoteName))
                {
                    GitClass.RemoveRemoteRepository(remoteName);
                    break;
                }
            }

            GitClass.AddRemoteRepository(remoteName, uri);
        }
Example #2
0
        internal void AddRemoteToLocalGitRepo(Site website)
        {
            // Get remote repos
            IList <string> remoteRepositories = GitClass.GetRemoteRepositories();

            if (remoteRepositories.Any(repository => repository.Equals("azure")))
            {
                // Removing existing azure remote alias
                GitClass.RemoveRemoteRepository("azure");
            }

            string repositoryUri = website.GetProperty("RepositoryUri");

            string uri = GitClass.GetUri(repositoryUri, Name, PublishingUsername);

            GitClass.AddRemoteRepository("azure", uri);
        }