From 32841341cdfd2218b0a39c108a4cebe3bcdb6339 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 13 Nov 2016 19:39:12 +0000 Subject: [PATCH] Don't show .git dir, show diffs in non anim mode --- lib/get-branch.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/get-branch.php b/lib/get-branch.php index 2fe2b5a..dff4e22 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -71,8 +71,8 @@ if (!isset($ftpSite) && $_SESSION['githubDiff']) { if (is_dir($scanpath) && strpos($scanpath,".git") == false) { $thisDir = str_replace("\\","/",$scanpath); if(hasGitignore($thisDir)) { - $gi[] = $thisDir."/.gitignore"; - } + $gi[] = $thisDir."/.gitignore"; + } } } @@ -149,6 +149,10 @@ foreach($finalArray as $entry) { if (!isset($ftpSite) && $docRoot.$iceRoot.$location."/".$entry == $docRoot.$ICEcoderDir) { $canAdd = false; } + // Ignore .git dir in GitHub diff mode + if (!isset($ftpSite) && $_SESSION['githubDiff'] && strpos($docRoot.$iceRoot.$location."/".$entry,"/.git") !== false) { + $canAdd = false; + } if ($entry != "." && $entry != ".." && $canAdd) { if (!isset($ftpSite)) { is_dir($docRoot.$iceRoot.$location."/".$entry) @@ -388,7 +392,7 @@ if (!isset($ftpSite) && $_SESSION['githubDiff']) { // Now display folders & files // Animate into view? - if (folderItems.length <= 50) { + if ( && folderItems.length <= 50) { showFileI=0; animFolders = setInterval(function() { showFileI++;