controller: Remove redundant method

This commit is contained in:
Hylke Bons 2016-04-01 09:24:01 +01:00
parent ea0e6c1654
commit 6f826ba205
3 changed files with 5 additions and 11 deletions

View file

@ -721,15 +721,8 @@ namespace SparkleShare {
string [] files = Directory.GetFiles (path);
foreach (string file in files)
if (!IsSymlink (file))
if (file.IsSymlink ())
File.SetAttributes (file, FileAttributes.Normal);
}
bool IsSymlink (string file)
{
FileAttributes attributes = File.GetAttributes (file);
return ((attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint);
}
}
}

View file

@ -81,8 +81,9 @@ namespace Sparkles {
}
public static bool IsSymlink (this FileSystemInfo file)
public static bool IsSymlink (this string path)
{
var file = new FileInfo (path);
return ((file.Attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint);
}

View file

@ -1116,7 +1116,7 @@ namespace Sparkles.Git {
try {
foreach (DirectoryInfo directory in parent.GetDirectories ()) {
if (directory.IsSymlink () ||
if (directory.FullName.IsSymlink () ||
directory.Name.Equals (".git") ||
directory.Name.Equals ("rebase-apply")) {
@ -1132,7 +1132,7 @@ namespace Sparkles.Git {
try {
foreach (FileInfo file in parent.GetFiles ()) {
if (file.IsSymlink ())
if (file.FullName.IsSymlink ())
continue;
if (file.Name.Equals (".empty"))