Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Git.php

function Git::checkTracked

Determines whether the specified scaffold file is tracked by git.

Parameters

\Composer\IO\IOInterface $io: The Composer IO interface.

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 56

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;
}
RSS feed
Powered by Drupal