[repo] Replace gitsharp's AnyDifferences by own implementation
This commit is contained in:
parent
91f629b5d5
commit
17d07bb2eb
|
@ -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 ();
|
||||
|
||||
|
@ -582,6 +582,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
|
||||
private void Add ()
|
||||
{
|
||||
|
@ -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 ();
|
||||
|
||||
|
|
|
@ -242,6 +242,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) {
|
||||
|
||||
GetAvatar (commit.UserEmail, 36);
|
||||
|
|
Loading…
Reference in a new issue