From 9c5a38f3522e5e9e770f463f6abcac8ca4fbaf83 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 2 Mar 2011 22:07:05 +0000 Subject: [PATCH] [repo] fix crash caused by GetCommits(n) returning n-1 entries --- SparkleLib/SparkleRepo.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index 61a80e86..a3ece0f0 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -251,7 +251,7 @@ namespace SparkleLib { public SparkleRepo (string path) : base (path) { - + LocalPath = path; Name = Path.GetFileName (LocalPath); @@ -773,7 +773,7 @@ namespace SparkleLib { _CurrentHash = Head.CurrentCommit.Hash; if (NewCommit != null) - NewCommit (GetCommits (2) [0], LocalPath); // FIXME: GetCommits doesn't like 1 + NewCommit (GetCommits (1) [0], LocalPath); SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Changes rebased."); @@ -941,6 +941,7 @@ namespace SparkleLib { if (count < 1) count = 30; + List commits = new List (); @@ -954,7 +955,7 @@ namespace SparkleLib { List entries = new List (); int j = 0; - string entry = ""; + string entry = "", last_entry = ""; foreach (string line in lines) { if (line.StartsWith ("commit") && j > 0) { @@ -966,9 +967,13 @@ namespace SparkleLib { entry += line + "\n"; j++; + + last_entry = entry; } + entries.Add (last_entry); + foreach (string log_entry in entries) {