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

Breadcrumb

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

function GitDownloader::getLocalChanges

@inheritDoc

Overrides ChangeReportInterface::getLocalChanges

1 call to GitDownloader::getLocalChanges()
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Downloader/GitDownloader.php, line 214

Class

GitDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

public function getLocalChanges(PackageInterface $package, string $path) : ?string {
    GitUtil::cleanEnv();
    if (!$this->hasMetadataRepository($path)) {
        return null;
    }
    $command = [
        'git',
        'status',
        '--porcelain',
        '--untracked-files=no',
    ];
    if (0 !== $this->process
        ->execute($command, $output, $path)) {
        throw new \RuntimeException('Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process
            ->getErrorOutput());
    }
    $output = trim($output);
    return strlen($output) > 0 ? $output : null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal