From 6a7801c64013bac07649b19756e0991d7c031ac3 Mon Sep 17 00:00:00 2001
From: David Stainton <dstainton415@gmail.com>
Date: Mon, 14 Sep 2015 06:29:56 +0200
Subject: [PATCH] Simply should_ignore_file helper function

---
 src/allmydata/magicpath.py | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/allmydata/magicpath.py b/src/allmydata/magicpath.py
index e2728421..b072b463 100644
--- a/src/allmydata/magicpath.py
+++ b/src/allmydata/magicpath.py
@@ -9,22 +9,15 @@ def magic2path(path):
     return re.sub(ur'@[_@]', lambda m: {u'@_': u'/', u'@@': u'@'}[m.group(0)], path)
 
 
-IGNORE_SUFFIXES = ['.backup', '.tmp', '.conflicted']
-IGNORE_PREFIXES = ['.']
+IGNORE_SUFFIXES = [u'.backup', u'.tmp', u'.conflicted']
+IGNORE_PREFIXES = [u'.']
 
 def should_ignore_file(path_u):
     for suffix in IGNORE_SUFFIXES:
         if path_u.endswith(suffix):
             return True
-    while True:
-        head, tail = os.path.split(path_u)
-        if tail != "":
-            for prefix in IGNORE_PREFIXES:
-                if tail.startswith(prefix):
-                    return True
-                else:
-                    path_u = head
-        else:
-            if head == "":
-                return False
+    while path_u != u"":
+        path_u, tail_u = os.path.split(path_u)
+        if tail_u.startswith(u"."):
+            return True
     return False
-- 
2.45.2