repo git: reduce the number of status commands being called on activity
This commit is contained in:
parent
72beb68a4c
commit
c1d6289507
|
@ -230,10 +230,10 @@ namespace SparkleLib.Git {
|
||||||
|
|
||||||
public override bool SyncUp ()
|
public override bool SyncUp ()
|
||||||
{
|
{
|
||||||
if (HasLocalChanges) {
|
string message = FormatCommitMessage ();
|
||||||
Add ();
|
|
||||||
|
|
||||||
string message = FormatCommitMessage ();
|
if (message != null) {
|
||||||
|
Add ();
|
||||||
Commit (message);
|
Commit (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,11 +456,11 @@ namespace SparkleLib.Git {
|
||||||
// Merges the fetched changes
|
// Merges the fetched changes
|
||||||
private bool Rebase ()
|
private bool Rebase ()
|
||||||
{
|
{
|
||||||
if (HasLocalChanges) {
|
string message = FormatCommitMessage ();
|
||||||
|
|
||||||
|
if (message != null) {
|
||||||
Add ();
|
Add ();
|
||||||
|
Commit (message);
|
||||||
string commit_message = FormatCommitMessage ();
|
|
||||||
Commit (commit_message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SparkleGit git;
|
SparkleGit git;
|
||||||
|
@ -1046,7 +1046,10 @@ namespace SparkleLib.Git {
|
||||||
git_status.StandardOutput.ReadToEnd ();
|
git_status.StandardOutput.ReadToEnd ();
|
||||||
git_status.WaitForExit ();
|
git_status.WaitForExit ();
|
||||||
|
|
||||||
return message;
|
if (string.IsNullOrWhiteSpace (message))
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -245,12 +245,12 @@ namespace SparkleLib {
|
||||||
SparkleLogger.LogInfo ("Local", Name + " | Activity detected, waiting for it to settle...");
|
SparkleLogger.LogInfo ("Local", Name + " | Activity detected, waiting for it to settle...");
|
||||||
|
|
||||||
List<double> size_buffer = new List<double> ();
|
List<double> size_buffer = new List<double> ();
|
||||||
|
DirectoryInfo info = new DirectoryInfo (LocalPath);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (size_buffer.Count >= 4)
|
if (size_buffer.Count >= 4)
|
||||||
size_buffer.RemoveAt (0);
|
size_buffer.RemoveAt (0);
|
||||||
|
|
||||||
DirectoryInfo info = new DirectoryInfo (LocalPath);
|
|
||||||
size_buffer.Add (CalculateSize (info));
|
size_buffer.Add (CalculateSize (info));
|
||||||
|
|
||||||
if (size_buffer.Count >= 4 &&
|
if (size_buffer.Count >= 4 &&
|
||||||
|
|
Loading…
Reference in a new issue