From 05fe993b89cf22643508fcb59860aef17e9ec3fc Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 12 Mar 2011 18:36:03 +0000 Subject: [PATCH] Use SparkleLib.IsRepo for folder checking --- SparkleLib/SparkleRepo.cs | 7 +++++++ SparkleShare/SparkleController.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index 052b28ca..4fad106f 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -1153,6 +1153,13 @@ namespace SparkleLib { } + public static bool IsRepo (string path) { + + return System.IO.Directory.Exists (Path.Combine (path, ".git")); + + } + + // Disposes all resourses of this object new public void Dispose () { diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 1f696f48..dec865ea 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -138,7 +138,7 @@ namespace SparkleShare { if (OnInvitation != null) OnInvitation (server, folder, token); - } else if (Directory.Exists (Path.Combine (args.FullPath, ".git"))) { + } else if (SparkleRepo.IsRepo (args.FullPath)) { AddRepository (args.FullPath); @@ -509,7 +509,7 @@ namespace SparkleShare { { // Check if the folder is a Git repository - if (!Directory.Exists (SparkleHelpers.CombineMore (folder_path, ".git"))) + if (!SparkleRepo.IsRepo (folder_path)) return; SparkleRepo repo = new SparkleRepo (folder_path);