[repo] Replace gitsharp's AnyDifferences by own implementation

This commit is contained in:
Hylke Bons 2011-03-04 13:59:59 +00:00
parent 0911117e31
commit 0005a76388
2 changed files with 27 additions and 4 deletions

View file

@ -486,7 +486,7 @@ namespace SparkleLib {
_IsBuffering = false;
HasChanged = false;
while (Status.AnyDifferences) {
while (AnyDifferences) {
Watcher.EnableRaisingEvents = false;
AddCommitAndPush ();
@ -554,7 +554,7 @@ namespace SparkleLib {
LocalTimer.Stop ();
RemoteTimer.Stop ();
if (Status.AnyDifferences) {
if (AnyDifferences) {
Add ();
@ -580,6 +580,26 @@ namespace SparkleLib {
}
}
public bool AnyDifferences {
get {
SparkleGit git = new SparkleGit (LocalPath, "status --porcelain");
git.Start ();
git.WaitForExit ();
string output = git.StandardOutput.ReadToEnd ().Trim ();
if (output.Length > 0)
return true;
else
return false;
}
}
// Stages the made changes
@ -624,7 +644,7 @@ namespace SparkleLib {
new public void Commit (string message)
{
if (!Status.AnyDifferences)
if (!AnyDifferences)
return;
base.Commit (message);
@ -710,7 +730,7 @@ namespace SparkleLib {
public void Rebase ()
{
if (Status.AnyDifferences) {
if (AnyDifferences) {
Add ();

View file

@ -241,6 +241,9 @@ namespace SparkleShare {
List <SparkleCommit> commits = GetLog (name);
List <ActivityDay> activity_days = new List <ActivityDay> ();
if (commits.Count == 0)
return null;
foreach (SparkleCommit commit in commits) {