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

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
altering
substr($var, 0, 1) === $char
to
strpos($var, $char) === 0
  • Loading branch information
rotelok committed Jun 16, 2018
commit f4fe032d7778d28bdcebe447939ab62c37545fde
4 changes: 2 additions & 2 deletions lib/get-branch.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
foreach ($lines as $line) {
$line = trim($line);
if ($line === '') continue; # empty line
if (substr($line, 0, 1) == '#') continue; # a comment
if (substr($line, 0, 1) == '!') { # negated glob
if (strpos($line, '#') === 0) continue; # a comment
if (strpos($line, '!') === 0) { # negated glob
$line = substr($line, 1);
$files = array_diff(glob("$dir/*"), glob("$dir/$line"));
} else { # normal glob
Expand Down