Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Don't show .git dir, show diffs in non anim mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpass committed Nov 13, 2016
1 parent 3e31879 commit 3284134
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/get-branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function hasGitignore($dir) {
if (is_dir($scanpath) && strpos($scanpath,".git") == false) {
$thisDir = str_replace("\\","/",$scanpath);
if(hasGitignore($thisDir)) {
$gi[] = $thisDir."/.gitignore";
}
$gi[] = $thisDir."/.gitignore";
}
}
}

Expand Down Expand Up @@ -149,6 +149,10 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
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)
Expand Down Expand Up @@ -388,7 +392,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
// Now display folders & files

// Animate into view?
if (folderItems.length <= 50) {
if (<?php echo !$_SESSION['githubDiff'] ? "true" : "false";?> && folderItems.length <= 50) {
showFileI=0;
animFolders = setInterval(function() {
showFileI++;
Expand Down

0 comments on commit 3284134

Please sign in to comment.