Skip to content

Commit

Permalink
Merge pull request #3809 from datengraben/master
Browse files Browse the repository at this point in the history
Fix gitblame to not use full path when `chdir`
  • Loading branch information
jrfnl authored Aug 1, 2023
2 parents 354b4c5 + af44889 commit 50e1fb5
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 50e1fb5

Please sign in to comment.