From 1e9d6b752c5b431157049480eadda2c07520be06 Mon Sep 17 00:00:00 2001 From: Beau Gunderson Date: Wed, 14 Sep 2011 12:19:53 -0700 Subject: [PATCH] Added the GIT_SSH environment variable and set it to "ssh" so that git will use ssh-agent; fixed a bug where SparkleShare creates an exclude file within the "info" directory without checking if the "info" directory exists. --- SparkleLib/Git/SparkleFetcherGit.cs | 16 ++++++++++++++-- SparkleShare/Windows/SparkleWinController.cs | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index b8e6a75e..e4e0232a 100644 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -138,10 +138,22 @@ namespace SparkleLib { // Add a .gitignore file to the repo private void InstallExcludeRules () { - string exlude_rules_file_path = SparkleHelpers.CombineMore ( + string exclude_rules_file_path = SparkleHelpers.CombineMore ( this.target_folder, ".git", "info", "exclude"); - TextWriter writer = new StreamWriter (exlude_rules_file_path); + string directory = Path.GetDirectoryName(exclude_rules_file_path); + + if (directory == null) + { + return; + } + + if (!Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + TextWriter writer = new StreamWriter (exclude_rules_file_path); // gedit and emacs writer.WriteLine ("*~"); diff --git a/SparkleShare/Windows/SparkleWinController.cs b/SparkleShare/Windows/SparkleWinController.cs index 202cc4e9..93b95533 100644 --- a/SparkleShare/Windows/SparkleWinController.cs +++ b/SparkleShare/Windows/SparkleWinController.cs @@ -58,8 +58,10 @@ namespace SparkleShare { + MSysGit + @"\mingw\bin" + ";" + MSysGit + @"\cmd" + ";" + System.Environment.ExpandEnvironmentVariables ("%PATH%"); + System.Environment.SetEnvironmentVariable ("PATH", newPath); System.Environment.SetEnvironmentVariable ("PLINK_PROTOCOL", "ssh"); + System.Environment.SetEnvironmentVariable ("GIT_SSH", "ssh"); if (String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable ("HOME"))) System.Environment.SetEnvironmentVariable ("HOME", Environment.ExpandEnvironmentVariables ("%HOMEDRIVE%%HOMEPATH%"));