Read the gitignore file.
authorGunnar Wrobel <p@rdus.de>
Tue, 2 Nov 2010 18:23:26 +0000 (19:23 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 2 Nov 2010 19:39:05 +0000 (20:39 +0100)
components/lib/Components/Helper/Root.php
components/test/Components/fixture/.gitignore [new file with mode: 0644]

index e832b0f..d6d9d22 100644 (file)
@@ -57,7 +57,9 @@ class Components_Helper_Root
         while ($current != '/' || $i < 10) {
             if (is_dir($current)) {
                 $objects = scandir($current);
-                if (in_array('framework', $objects) && in_array('horde', $objects)) {
+                if (in_array('framework', $objects)
+                    && in_array('horde', $objects)
+                    && in_array('.gitignore', $objects)) {
                     $this->_root_path = $current;
                     break;
                 }
@@ -106,7 +108,7 @@ class Components_Helper_Root
      */
     public function getGitIgnore()
     {
-        return '';
+        return file_get_contents($this->_root_path . DIRECTORY_SEPARATOR . '.gitignore');
     }
 
     /**
diff --git a/components/test/Components/fixture/.gitignore b/components/test/Components/fixture/.gitignore
new file mode 100644 (file)
index 0000000..80011f8
--- /dev/null
@@ -0,0 +1 @@
+IGNORE.txt