[repo] fix crash caused by GetCommits(n) returning n-1 entries
This commit is contained in:
parent
b22fabf5c6
commit
9c5a38f352
|
@ -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.");
|
||||
|
||||
|
@ -942,6 +942,7 @@ namespace SparkleLib {
|
|||
if (count < 1)
|
||||
count = 30;
|
||||
|
||||
|
||||
List <SparkleCommit> commits = new List <SparkleCommit> ();
|
||||
|
||||
SparkleGit git_log = new SparkleGit (LocalPath, "log -" + count + " --raw --date=iso");
|
||||
|
@ -954,7 +955,7 @@ namespace SparkleLib {
|
|||
List <string> entries = new List <string> ();
|
||||
|
||||
int j = 0;
|
||||
string entry = "";
|
||||
string entry = "", last_entry = "";
|
||||
foreach (string line in lines) {
|
||||
|
||||
if (line.StartsWith ("commit") && j > 0) {
|
||||
|
@ -967,8 +968,12 @@ namespace SparkleLib {
|
|||
entry += line + "\n";
|
||||
j++;
|
||||
|
||||
last_entry = entry;
|
||||
|
||||
}
|
||||
|
||||
entries.Add (last_entry);
|
||||
|
||||
|
||||
foreach (string log_entry in entries) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue