Esempio n. 1
0
        public static async Task BUYLCloneOrUpdateRepository()
        {
            if (!CheckForContentRepositoryDirectory())
            {
                //prg.ShowDialog();
                Directory.CreateDirectory(pathToLocalContentRepository);

                LibGit2Sharp.CloneOptions op = new LibGit2Sharp.CloneOptions();

                LibGit2Sharp.Repository.Clone(urlContentRepository, pathToLocalContentRepository, op);

                LogManager.FileLogService.Instance.Info(string.Format("Repository cloned to {0}", pathToLocalContentRepository), typeof(GitContentLoader));
                //prg.Close();
            }
            else
            {
                using (var repo = new LibGit2Sharp.Repository(pathToLocalContentRepository))
                {
                    LibGit2Sharp.Remote       remote = repo.Network.Remotes["origin"];
                    LibGit2Sharp.FetchOptions op     = new LibGit2Sharp.FetchOptions();
                    repo.Network.Fetch(remote);
                    LogManager.FileLogService.Instance.Info(string.Format("Repository update fetched to {0}", pathToLocalContentRepository), typeof(GitContentLoader));
                }
            }
        }
Esempio n. 2
0
 internal Remote(LibGit2Sharp.Remote remote)
 {
     innerRemote = remote;
 }