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);