1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01: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)) { if (count($lines) !== count($unresolved)) {
throw new Exception( throw new Exception(
pht( pht(
'Unexpected line count from `%s`!', 'Unexpected line count from `%s` in %s!',
'git cat-file')); 'git cat-file',
$repository->getMonogram()));
} }
$hits = array(); $hits = array();
@ -153,8 +154,9 @@ final class DiffusionLowLevelResolveRefsQuery
if (count($parts) < 2) { if (count($parts) < 2) {
throw new Exception( throw new Exception(
pht( pht(
'Failed to parse `%s` output: %s', 'Failed to parse `%s` output in %s: %s',
'git cat-file', 'git cat-file',
$repository->getMonogram(),
$line)); $line));
} }
list($identifier, $type) = $parts; list($identifier, $type) = $parts;
@ -177,8 +179,9 @@ final class DiffusionLowLevelResolveRefsQuery
default: default:
throw new Exception( throw new Exception(
pht( pht(
'Unexpected object type from `%s`: %s', 'Unexpected object type from `%s` in %s: %s',
'git cat-file', 'git cat-file',
$repository->getMonogram(),
$line)); $line));
} }