private PlotCommitList<PlotLane> GetAlltCommits()
        {
            var workingDirectoryPath = new Sharpen.FilePath(GitWorkingDirectory);
            var git = Git.Open(workingDirectoryPath);
            var repository = git.GetRepository();

            try
            {
                var plotWalk = new PlotWalk(repository);
                var refsByPeeledList = repository.GetAllRefsByPeeledObjectId();
                var revCommitList = refsByPeeledList
                                    .Keys
                                    .Select(id => plotWalk.ParseCommit(id))
                                    .ToList();

                plotWalk.MarkStart(revCommitList);

                var commits = new PlotCommitList<PlotLane>();
                commits.Source(plotWalk);
                commits.FillTo(int.MaxValue);

                return commits;
            }
            finally
            {
                git.GetRepository().Close();
                git.GetRepository().ObjectDatabase.Close();
            }
        }
Esempio n. 2
0
 public static void cloneRepo(List<Repos> repolist,string path)
 {
     var credentials = new UsernamePasswordCredentialsProvider(Credencials.user, Credencials.password);
     for (int i = 0; i < repolist.Count; i++)
     {
         var checkeditem = repolist[i];
         Sharpen.FilePath dir = new Sharpen.FilePath(path + "\\" + checkeditem.name);
         dir.Mkdir();
         Git.CloneRepository().SetDirectory(dir).SetURI(checkeditem.clone_url).SetCredentialsProvider(credentials).Call().GetRepository().Close();
     }
 }
Esempio n. 3
0
        public void Open(string path)
        {
            var p = new Sharpen.FilePath(path);

            try
            {
                m_git = NGit.Api.Git.Open(p);
            }
            catch (Exception ex)
            {
            }
            if (m_git == null)
            {
                Init(path);
            }
        }
Esempio n. 4
0
 public void Open(string path)
 {
     var p = new Sharpen.FilePath(path);
     try
     {
         m_git = NGit.Api.Git.Open(p);
     }
     catch (Exception ex)
     {
     }
     if (m_git == null)
     {
         Init(path);
     }
 }