Explorar o código

Always clear git env vars

Jordi Boggiano %!s(int64=12) %!d(string=hai) anos
pai
achega
48b6e8cd21
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  1. 2 6
      src/Composer/Util/Git.php

+ 2 - 6
src/Composer/Util/Git.php

@@ -29,11 +29,7 @@ class Git
         putenv('GIT_ASKPASS=echo');
 
         // clean up rogue git env vars in case this is running in a git hook
-        if (getenv('GIT_DIR')) {
-            putenv('GIT_DIR');
-        }
-        if (getenv('GIT_WORK_TREE')) {
-            putenv('GIT_WORK_TREE');
-        }
+        putenv('GIT_DIR');
+        putenv('GIT_WORK_TREE');
     }
 }