Skip to content

Commit

Permalink
Reports/GitBlame: Fix invocation path of git blame
Browse files Browse the repository at this point in the history
After we change into the files directory, invocation of git blame with full path will end in fatal error.
  • Loading branch information
datengraben committed Apr 21, 2023
1 parent ed8e00d commit af44889
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Reports/Gitblame.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af44889

Please sign in to comment.