repo git: reuse git objects

This commit is contained in:
Hylke Bons 2012-06-24 23:20:45 +01:00
parent 6579fdb5e1
commit 330e80c22b

View file

@ -390,23 +390,25 @@ namespace SparkleLib.Git {
// Commits the made changes // Commits the made changes
private void Commit (string message) private void Commit (string message)
{ {
SparkleGit git;
if (!this.author_set) { if (!this.author_set) {
SparkleGit git_set_author = new SparkleGit (LocalPath, git = new SparkleGit (LocalPath,
"config user.name \"" + SparkleConfig.DefaultConfig.User.Name + "\""); "config user.name \"" + SparkleConfig.DefaultConfig.User.Name + "\"");
git_set_author.Start (); git.Start ();
git_set_author.WaitForExit (); git.WaitForExit ();
git_set_author = new SparkleGit (LocalPath, git = new SparkleGit (LocalPath,
"config user.email \"" + SparkleConfig.DefaultConfig.User.Email + "\""); "config user.email \"" + SparkleConfig.DefaultConfig.User.Email + "\"");
git_set_author.Start (); git.Start ();
git_set_author.WaitForExit (); git.WaitForExit ();
this.author_set = true; this.author_set = true;
} }
SparkleGit git = new SparkleGit (LocalPath, git = new SparkleGit (LocalPath,
"commit -m \"" + message + "\" " + "commit -m \"" + message + "\" " +
"--author=\"" + SparkleConfig.DefaultConfig.User.Name + "--author=\"" + SparkleConfig.DefaultConfig.User.Name +
" <" + SparkleConfig.DefaultConfig.User.Email + ">\""); " <" + SparkleConfig.DefaultConfig.User.Email + ">\"");
@ -414,8 +416,6 @@ namespace SparkleLib.Git {
git.Start (); git.Start ();
git.StandardOutput.ReadToEnd (); git.StandardOutput.ReadToEnd ();
git.WaitForExit (); git.WaitForExit ();
SparkleHelpers.DebugInfo ("Commit", Name + " | " + message);
} }