Browse Source

fix(store): make isHidden see if any portion of the path is hidden, not just the last element

tobz 12 years ago
parent
commit
823fdfab12
1 changed files with 3 additions and 8 deletions
  1. 3 8
      store/watcher_hub.go

+ 3 - 8
store/watcher_hub.go

@@ -158,13 +158,8 @@ func (wh *watcherHub) clone() *watcherHub {
 	}
 }
 
-// isHidden checks if a path has a hidden key.  since we don't get the Node
-// object for notifyWatchers, we have to duplicate it here. consolidate me?
+// isHidden checks to see if this path is considered hidden i.e. the
+// last element is hidden or it's within a hidden directory
 func isHidden(nodePath string) bool {
-	_, name := path.Split(nodePath)
-	if name == "" {
-		return false
-	}
-
-	return name[0] == '_'
+	return strings.Contains(nodePath, "/_")
 }