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 ()
|
||||
{
|
||||
if (HasLocalChanges) {
|
||||
Add ();
|
||||
string message = FormatCommitMessage ();
|
||||
|
||||
string message = FormatCommitMessage ();
|
||||
if (message != null) {
|
||||
Add ();
|
||||
Commit (message);
|
||||
}
|
||||
|
||||
|
@ -456,11 +456,11 @@ namespace SparkleLib.Git {
|
|||
// Merges the fetched changes
|
||||
private bool Rebase ()
|
||||
{
|
||||
if (HasLocalChanges) {
|
||||
string message = FormatCommitMessage ();
|
||||
|
||||
if (message != null) {
|
||||
Add ();
|
||||
|
||||
string commit_message = FormatCommitMessage ();
|
||||
Commit (commit_message);
|
||||
Commit (message);
|
||||
}
|
||||
|
||||
SparkleGit git;
|
||||
|
@ -1046,7 +1046,10 @@ namespace SparkleLib.Git {
|
|||
git_status.StandardOutput.ReadToEnd ();
|
||||
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...");
|
||||
|
||||
List<double> size_buffer = new List<double> ();
|
||||
DirectoryInfo info = new DirectoryInfo (LocalPath);
|
||||
|
||||
do {
|
||||
if (size_buffer.Count >= 4)
|
||||
size_buffer.RemoveAt (0);
|
||||
|
||||
DirectoryInfo info = new DirectoryInfo (LocalPath);
|
||||
size_buffer.Add (CalculateSize (info));
|
||||
|
||||
if (size_buffer.Count >= 4 &&
|
||||
|
|
Loading…
Reference in a new issue