Skip to content

Commit 63eb31c

Browse files
authored
Error when checking out a pull request (microsoft#2779)
1 parent 5dd3ba7 commit 63eb31c

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/common/utils.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ export function formatError(e: HookError | any): string {
171171
if (e.gitErrorCode) {
172172
// known git errors, we should display detailed git error messages.
173173
return `${e.message}. Please check git output for more details`;
174+
} else if (e.stderr) {
175+
return `${e.stderr}. Please check git output for more details`;
174176
}
175177
return 'Error';
176178
}
@@ -225,13 +227,13 @@ export async function promiseFromEvent<T, U>(event: Event<T>, adapter: PromiseAd
225227
let subscription: Disposable;
226228
return new Promise<U>(
227229
(resolve, reject) =>
228-
(subscription = event((value: T) => {
229-
try {
230-
Promise.resolve<U>(adapter(value, resolve as any, reject)).catch(reject);
231-
} catch (error) {
232-
reject(error);
233-
}
234-
})),
230+
(subscription = event((value: T) => {
231+
try {
232+
Promise.resolve<U>(adapter(value, resolve as any, reject)).catch(reject);
233+
} catch (error) {
234+
reject(error);
235+
}
236+
})),
235237
).then(
236238
(result: U) => {
237239
subscription.dispose();
@@ -416,7 +418,7 @@ export class ConfigKeysIterator implements IKeyIterator<string> {
416418
private _from!: number;
417419
private _to!: number;
418420

419-
constructor(private readonly _caseSensitive: boolean = true) {}
421+
constructor(private readonly _caseSensitive: boolean = true) { }
420422

421423
reset(key: string): this {
422424
this._value = key;
@@ -464,7 +466,7 @@ export class PathIterator implements IKeyIterator<string> {
464466
private _from!: number;
465467
private _to!: number;
466468

467-
constructor(private readonly _splitOnBackslash: boolean = true, private readonly _caseSensitive: boolean = true) {}
469+
constructor(private readonly _splitOnBackslash: boolean = true, private readonly _caseSensitive: boolean = true) { }
468470

469471
reset(key: string): this {
470472
this._value = key.replace(/\\$|\/$/, '');
@@ -521,7 +523,7 @@ export class UriIterator implements IKeyIterator<Uri> {
521523
private _states: UriIteratorState[] = [];
522524
private _stateIdx: number = 0;
523525

524-
constructor(private readonly _ignorePathCasing: (uri: Uri) => boolean) {}
526+
constructor(private readonly _ignorePathCasing: (uri: Uri) => boolean) { }
525527

526528
reset(key: Uri): this {
527529
this._value = key;

0 commit comments

Comments
 (0)