Exemplo n.º 1
0
 private void PollCommitments(GitSharp.Repository repo)
 {
     int i = 0;
     string name = string.Empty;
     string authorname = string.Empty;
     string authoremail = string.Empty;
     string message = string.Empty;
     System.DateTimeOffset commitdate;
     bool loopcontrol = true;
     while (loopcontrol)
     {
         if (i == 0)
         {
             name = "HEAD";
             i++;
         }
         else
         {
             name = name + "^";
         }
         var c1 = new GitSharp.Commit(repo, name);
         try
         {
             authorname = c1.Author.Name;
             authoremail = c1.Author.EmailAddress;
             message = c1.Message;
             commitdate = c1.CommitDate;
             //Load to Database
         }
         catch
         {
             loopcontrol = false;
         }
     }
 }
Exemplo n.º 2
0
 private void PollCommitments(GitSharp.Repository repo, string RepositoryId)
 {
     int i = 0;
     string name = string.Empty;
     string hash = string.Empty;
     string authorname = string.Empty;
     string authoremail = string.Empty;
     string message = string.Empty;
     System.DateTimeOffset commitdate;
     bool loopcontrol = true;
     while (loopcontrol)
     {
         if (i == 0)
         {
             name = "HEAD";
             i++;
         }
         else
         {
             name = name + "^";
         }
         var c1 = new GitSharp.Commit(repo, name);
         try
         {
             hash = c1.Hash;
             authorname = c1.Author.Name;
             authoremail = c1.Author.EmailAddress;
             message = c1.Message;
             commitdate = c1.CommitDate;
             InsertCommit(RepositoryId,hash,authorname,authoremail,message,commitdate.DateTime.ToString());
         }
         catch
         {
             loopcontrol = false;
         }
     }
 }