File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -896,7 +896,7 @@ export class Git {
896896 ) ;
897897 return result . stdout ;
898898 } catch ( ex ) {
899- if ( ex instanceof RunError && ex . stdout ) {
899+ if ( ex instanceof GitError && ex . stdout ) {
900900 return ex . stdout ;
901901 }
902902
@@ -1475,9 +1475,9 @@ export class Git {
14751475 }
14761476 } catch ( ex ) {
14771477 if (
1478- ex instanceof RunError &&
1479- ex . stdout . includes ( 'Saved working directory and index state' ) &&
1480- ex . stderr . includes ( 'Cannot remove worktree changes' )
1478+ ex instanceof GitError &&
1479+ ex . stdout ? .includes ( 'Saved working directory and index state' ) &&
1480+ ex . stderr ? .includes ( 'Cannot remove worktree changes' )
14811481 ) {
14821482 throw new StashPushError ( StashPushErrorReason . ConflictingStagedAndUnstagedLines ) ;
14831483 }
Original file line number Diff line number Diff line change @@ -39,9 +39,8 @@ import { normalizePath } from '../../../../system/path';
3939import { getSettledValue } from '../../../../system/promise' ;
4040import { maybeStopWatch } from '../../../../system/stopwatch' ;
4141import type { Git } from '../git' ;
42- import { GitErrors , gitLogDefaultConfigs } from '../git' ;
42+ import { GitError , GitErrors , gitLogDefaultConfigs } from '../git' ;
4343import type { LocalGitProvider } from '../localGitProvider' ;
44- import { RunError } from '../shell.errors' ;
4544
4645const emptyPagedResult : PagedResult < any > = Object . freeze ( { values : [ ] } ) ;
4746
@@ -612,7 +611,7 @@ export class BranchesGitSubProvider implements GitBranchesSubProvider {
612611 scope ,
613612 `Unable to merge '${ branch } ' and '${ targetBranch } ' as they have no common ancestor` ,
614613 ) ;
615- } else if ( ex instanceof RunError ) {
614+ } else if ( ex instanceof GitError ) {
616615 data = ex . stdout ;
617616 } else {
618617 Logger . error ( ex , scope ) ;
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ import { log } from '../../../../system/decorators/log';
2222import { join , map , min , skip } from '../../../../system/iterable' ;
2323import { getSettledValue } from '../../../../system/promise' ;
2424import type { Git } from '../git' ;
25- import { maxGitCliLength } from '../git' ;
26- import { RunError } from '../shell.errors' ;
25+ import { GitError , maxGitCliLength } from '../git' ;
2726import { createCommitFileset } from './commits' ;
2827
2928const stashSummaryRegex =
@@ -54,9 +53,9 @@ export class StashGitSubProvider implements GitStashSubProvider {
5453
5554 if (
5655 ( msg . includes ( 'Auto-merging' ) && msg . includes ( 'CONFLICT' ) ) ||
57- ( ex instanceof RunError &&
58- ( ( ex . stdout . includes ( 'Auto-merging' ) && ex . stdout . includes ( 'CONFLICT' ) ) ||
59- ex . stdout . includes ( 'needs merge' ) ) )
56+ ( ex instanceof GitError &&
57+ ( ( ex . stdout ? .includes ( 'Auto-merging' ) && ex . stdout . includes ( 'CONFLICT' ) ) ||
58+ ex . stdout ? .includes ( 'needs merge' ) ) )
6059 ) {
6160 void window . showInformationMessage ( 'Stash applied with conflicts' ) ;
6261
You can’t perform that action at this time.
0 commit comments