From 4612e5036df4cf2b5fb664a5c54e235ef38efc71 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Wed, 27 Aug 2014 08:13:00 +0100 Subject: [PATCH] Exclude .git dir --- lib/get-branch.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/get-branch.php b/lib/get-branch.php index c495758..9ddb100 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -92,7 +92,8 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore' } // Cycle through all .gitignore files running above function to get a list of $excluded files -$excluded = array(); +// Exclude the .git dir as first item as we don't want to see that +$excluded = array("|.git"); foreach ($gi as $scanpath) { $excludedTest = (parseGitignore($scanpath)); if (count($excludedTest) > 0) {