Git - reduce the number of getConfiguration() calls (#246295)

* Git - reduce the number of `getConfiguration()` calls

* Missed one
This commit is contained in:
Ladislau Szomoru
2025-04-11 09:12:35 +01:00
committed by GitHub
parent 18afe2b925
commit 88c1f24373
3 changed files with 66 additions and 55 deletions

View File

@@ -291,8 +291,8 @@ export function detectUnicodeEncoding(buffer: Buffer): Encoding | null {
return null;
}
export function truncate(value: string, maxLength = 20): string {
return value.length <= maxLength ? value : `${value.substring(0, maxLength)}\u2026`;
export function truncate(value: string, maxLength = 20, ellipsis = true): string {
return value.length <= maxLength ? value : `${value.substring(0, maxLength)}${ellipsis ? '\u2026' : ''}`;
}
function normalizePath(path: string): string {