1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Make "git cat-file" exception messages include repository monogram/slug

Summary:
When throwing an exception related to output provided by `git cat-file`, include the repository monogram to allow potentially debugging in Git.

Closes T15661

Test Plan:
Unclear. Basically: "have a broken Git repository in Diffusion".
(However this patch changes a message only shown in case of an exception, so in the worst case we'd break the exception via an exception.)

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15661

Differential Revision: https://we.phorge.it/D25460
This commit is contained in:
Andre Klapper 2023-11-09 20:23:03 +01:00
parent 0729aa574b
commit 87e9c936ad

View file

@ -140,8 +140,9 @@ final class DiffusionLowLevelResolveRefsQuery
if (count($lines) !== count($unresolved)) {
throw new Exception(
pht(
'Unexpected line count from `%s`!',
'git cat-file'));
'Unexpected line count from `%s` in %s!',
'git cat-file',
$repository->getMonogram()));
}
$hits = array();
@ -153,8 +154,9 @@ final class DiffusionLowLevelResolveRefsQuery
if (count($parts) < 2) {
throw new Exception(
pht(
'Failed to parse `%s` output: %s',
'Failed to parse `%s` output in %s: %s',
'git cat-file',
$repository->getMonogram(),
$line));
}
list($identifier, $type) = $parts;
@ -177,8 +179,9 @@ final class DiffusionLowLevelResolveRefsQuery
default:
throw new Exception(
pht(
'Unexpected object type from `%s`: %s',
'Unexpected object type from `%s` in %s: %s',
'git cat-file',
$repository->getMonogram(),
$line));
}