From f6dc8fb3bbbfbe9ab09d9987e7acc67d11ed2e36 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 27 Aug 2012 13:54:22 +0100 Subject: [PATCH] fetcher git: check if git info directory exists before writing to it. Fixes #934 --- SparkleLib/Git/SparkleFetcherGit.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 2dc1cf25..76a0027c 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -333,8 +333,13 @@ namespace SparkleLib.Git { // Add a .gitignore file to the repo private void InstallExcludeRules () { + string git_info_path = new string [] { TargetFolder, ".git", "info" }.Combine (); + + if (!Directory.Exists (git_info_path)) + Directory.CreateDirectory (git_info_path); + string exclude_rules = string.Join (Environment.NewLine, ExcludeRules); - string exclude_rules_file_path = new string [] { TargetFolder, ".git", "info", "exclude" }.Combine (); + string exclude_rules_file_path = new string [] { git_info_path, "exclude" }.Combine (); File.WriteAllText (exclude_rules_file_path, exclude_rules); }