[repo] Run 'git gc' about every 10 commits
This commit is contained in:
parent
383f674656
commit
4998fee49a
|
@ -618,6 +618,21 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
|
||||
// Removes unneeded objects
|
||||
private void CollectGarbage ()
|
||||
{
|
||||
|
||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Collecting garbage...");
|
||||
|
||||
Process.StartInfo.Arguments = "gc";
|
||||
Process.Start ();
|
||||
Process.WaitForExit ();
|
||||
|
||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Garbage collected..");
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Commits the made changes
|
||||
new public void Commit (string message)
|
||||
{
|
||||
|
@ -629,12 +644,17 @@ namespace SparkleLib {
|
|||
|
||||
SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message);
|
||||
|
||||
SparkleEventArgs args = new SparkleEventArgs ("Commited");
|
||||
args.Message = message;
|
||||
SparkleEventArgs args = new SparkleEventArgs ("Commited") {
|
||||
Message = message
|
||||
};
|
||||
|
||||
if (Commited != null)
|
||||
Commited (this, args);
|
||||
|
||||
// Collect garbage pseudo-randomly
|
||||
if (DateTime.Now.Second == 0)
|
||||
CollectGarbage ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -890,6 +910,7 @@ namespace SparkleLib {
|
|||
private bool ShouldIgnore (string file_path)
|
||||
{
|
||||
|
||||
// TODO: check against .git/info/exclude
|
||||
if (file_path.EndsWith (".lock") ||
|
||||
file_path.EndsWith ("~") ||
|
||||
file_path.Contains (".git") ||
|
||||
|
|
Loading…
Reference in a new issue