function Git::checkTracked

Same name in other branches
  1. 9 composer/Plugin/Scaffold/Git.php \Drupal\Composer\Plugin\Scaffold\Git::checkTracked()
  2. 10 composer/Plugin/Scaffold/Git.php \Drupal\Composer\Plugin\Scaffold\Git::checkTracked()
  3. 11.x composer/Plugin/Scaffold/Git.php \Drupal\Composer\Plugin\Scaffold\Git::checkTracked()

Determines whether the specified scaffold file is tracked by git.

Parameters

string $path: Path to scaffold file to check.

string $dir: Base directory for git process.

Return value

bool Whether the specified file is already tracked or not (TRUE if tracked).

2 calls to Git::checkTracked()
GenerateAutoloadReferenceFile::autoloadFileCommitted in composer/Plugin/Scaffold/GenerateAutoloadReferenceFile.php
Determines whether or not the autoload file has been committed.
ManageGitIgnore::manageIgnored in composer/Plugin/Scaffold/ManageGitIgnore.php
Manages gitignore files.

File

composer/Plugin/Scaffold/Git.php, line 50

Class

Git
Provide some Git utility operations

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public static function checkTracked(IOInterface $io, $path, $dir = NULL) {
    $process = new ProcessExecutor($io);
    $output = '';
    $exitCode = $process->execute('git ls-files --error-unmatch ' . $process->escape($path), $output, $dir);
    return $exitCode == 0;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.