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

Breadcrumb

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

function Git::cleanEnv

10 calls to Git::cleanEnv()
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::doDownload in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::doInstall in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::doUpdate in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::getLocalChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc

... See full list

File

vendor/composer/composer/src/Composer/Util/Git.php, line 533

Class

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

Namespace

Composer\Util

Code

public static function cleanEnv() : void {
    // added in git 1.7.1, prevents prompting the user for username/password
    if (Platform::getEnv('GIT_ASKPASS') !== 'echo') {
        Platform::putEnv('GIT_ASKPASS', 'echo');
    }
    // clean up rogue git env vars in case this is running in a git hook
    if (Platform::getEnv('GIT_DIR')) {
        Platform::clearEnv('GIT_DIR');
    }
    if (Platform::getEnv('GIT_WORK_TREE')) {
        Platform::clearEnv('GIT_WORK_TREE');
    }
    // Run processes with predictable LANGUAGE
    if (Platform::getEnv('LANGUAGE') !== 'C') {
        Platform::putEnv('LANGUAGE', 'C');
    }
    // clean up env for OSX, see https://github.com/composer/composer/issues/2146#issuecomment-35478940
    Platform::clearEnv('DYLD_LIBRARY_PATH');
}

API Navigation

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