From 59f3dc25d0054cb437293dcf8003d04358b03b8b Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 20 Dec 2023 07:31:50 +0100 Subject: [PATCH] More work on branch-specific PHP-CS-Fixer cache files --- .gitignore | 2 +- .php-cs-fixer.dist.php | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b2667fc9503..10389658082 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ # PHP-CS-Fixer /.php-cs-fixer.php -/.php-cs-fixer.cache* +/.php-cs-fixer.cache # Psalm /.psalm/cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index cc268e3937b..a73030c4d2f 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -341,10 +341,6 @@ 'whitespace_after_comma_in_array' => true, ]); -$branch = @trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD')); - -if (!empty($branch)) { - $config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache.' . $branch); -} +$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD')))); return $config;