From af44889ad0cb71e5dd360b88b5bbcad1d449eebe Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 21 Apr 2023 11:50:01 +0200 Subject: [PATCH] Reports/GitBlame: Fix invocation path of git blame After we change into the files directory, invocation of git blame with full path will end in fatal error. --- src/Reports/Gitblame.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reports/Gitblame.php b/src/Reports/Gitblame.php index 6427567f8d..0919e0e0ba 100644 --- a/src/Reports/Gitblame.php +++ b/src/Reports/Gitblame.php @@ -70,7 +70,7 @@ protected function getBlameContent($filename) $cwd = getcwd(); chdir(dirname($filename)); - $command = 'git blame --date=short "'.$filename.'" 2>&1'; + $command = 'git blame --date=short "'.basename($filename).'" 2>&1'; $handle = popen($command, 'r'); if ($handle === false) { $error = 'ERROR: Could not execute "'.$command.'"'.PHP_EOL.PHP_EOL;