Skip to content

Commit c4bf3b4

Browse files
committed
improve git error logging and fix deprecations
1 parent 7500fe0 commit c4bf3b4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/PackageDiff.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ private function getFileContents($path)
130130

131131
$output = array();
132132
@exec(sprintf('git show %s 2>&1', escapeshellarg($path)), $output, $exit);
133+
$outputString = implode("\n", $output);
133134

134135
if (0 !== $exit) {
135-
throw new \RuntimeException(sprintf('Could not open file %s or find it in git as %s', $originalPath, $path));
136+
throw new \RuntimeException(sprintf('Could not open file %s or find it in git as %s: %s', $originalPath, $path, $outputString));
136137
}
137138

138-
return implode("\n", $output);
139+
return $outputString;
139140
}
140141
}

src/Url/GitGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class GitGenerator implements UrlGenerator
1111
*/
1212
public function supportsPackage(PackageInterface $package)
1313
{
14-
return false !== strpos($package->getSourceUrl(), $this->getDomain());
14+
return false !== strpos((string) $package->getSourceUrl(), $this->getDomain());
1515
}
1616

1717
/**

0 commit comments

Comments
 (0)