From 77123874a3249f0df94e312c509d336598e74133 Mon Sep 17 00:00:00 2001 From: Alex Hudson Date: Mon, 2 Aug 2010 13:25:35 +0100 Subject: [PATCH] Give git the local working directory before looking for information. --- SparkleShare/SparkleRepo.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index a9c87391..0c38c3c9 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -71,6 +71,7 @@ namespace SparkleShare { LocalPath = path; Name = Path.GetFileName (LocalPath); + System.Console.WriteLine("New repo in {0}", LocalPath); Process = new Process () { EnableRaisingEvents = true @@ -470,6 +471,7 @@ namespace SparkleShare { process.StartInfo.RedirectStandardOutput = true; process.StartInfo.UseShellExecute = false; process.StartInfo.FileName = "git"; + process.StartInfo.WorkingDirectory = LocalPath; process.StartInfo.Arguments = "rev-list --max-count=1 HEAD"; process.Start (); @@ -490,6 +492,7 @@ namespace SparkleShare { process.StartInfo.RedirectStandardOutput = true; process.StartInfo.UseShellExecute = false; process.StartInfo.FileName = "git"; + process.StartInfo.WorkingDirectory = LocalPath; process.StartInfo.Arguments = "config --get user.name"; process.Start (); @@ -521,6 +524,7 @@ namespace SparkleShare { process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.FileName = "git"; + process.StartInfo.WorkingDirectory = LocalPath; process.StartInfo.Arguments = "config --get user.email"; process.Start (); user_email = process.StandardOutput.ReadToEnd ().Trim (); @@ -540,6 +544,7 @@ namespace SparkleShare { process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.FileName = "git"; + process.StartInfo.WorkingDirectory = LocalPath; process.StartInfo.Arguments = "config --get remote.origin.url"; process.Start ();