Use SparkleLib.IsRepo for folder checking

This commit is contained in:
Hylke Bons 2011-03-12 18:36:03 +00:00
parent be79dfdb06
commit 05fe993b89
2 changed files with 9 additions and 2 deletions

View file

@ -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 // Disposes all resourses of this object
new public void Dispose () new public void Dispose ()
{ {

View file

@ -138,7 +138,7 @@ namespace SparkleShare {
if (OnInvitation != null) if (OnInvitation != null)
OnInvitation (server, folder, token); OnInvitation (server, folder, token);
} else if (Directory.Exists (Path.Combine (args.FullPath, ".git"))) { } else if (SparkleRepo.IsRepo (args.FullPath)) {
AddRepository (args.FullPath); AddRepository (args.FullPath);
@ -509,7 +509,7 @@ namespace SparkleShare {
{ {
// Check if the folder is a Git repository // Check if the folder is a Git repository
if (!Directory.Exists (SparkleHelpers.CombineMore (folder_path, ".git"))) if (!SparkleRepo.IsRepo (folder_path))
return; return;
SparkleRepo repo = new SparkleRepo (folder_path); SparkleRepo repo = new SparkleRepo (folder_path);