@@ -110,7 +110,7 @@ import { countStringLength, filterMap } from '../../../system/array';
110110import { TimedCancellationSource } from '../../../system/cancellation' ;
111111import { gate } from '../../../system/decorators/gate' ;
112112import { debug , getLogScope , log } from '../../../system/decorators/log' ;
113- import { filterMap as filterMapIterable , find , first , last , some } from '../../../system/iterable' ;
113+ import { filterMap as filterMapIterable , find , first , join , last , map , some } from '../../../system/iterable' ;
114114import {
115115 commonBaseIndex ,
116116 dirname ,
@@ -1611,6 +1611,17 @@ export class LocalGitProvider implements GitProvider, Disposable {
16111611 ) : Promise < GitGraph > {
16121612 const scope = getLogScope ( ) ;
16131613
1614+ let stdin : string | undefined ;
1615+
1616+ // // TODO@eamodio this is insanity -- there *HAS* to be a better way to get git log to return stashes
1617+ const stash = await this . getStash ( repoPath ) ;
1618+ if ( stash != null ) {
1619+ stdin = join (
1620+ map ( stash . commits . values ( ) , c => c . sha . substring ( 0 , 7 ) ) ,
1621+ '\n' ,
1622+ ) ;
1623+ }
1624+
16141625 let getLogForRefFn ;
16151626 if ( options ?. ref != null ) {
16161627 async function getLogForRef ( this : LocalGitProvider ) : Promise < GitLog | undefined > {
@@ -1626,6 +1637,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
16261637 ordering : 'date' ,
16271638 limit : 0 ,
16281639 extraArgs : [ `--since="${ Number ( commit . date ) } "` , '--boundary' ] ,
1640+ stdin : stdin ,
16291641 } ) ;
16301642
16311643 let found = log ?. commits . has ( commit . sha ) ?? false ;
@@ -1668,25 +1680,34 @@ export class LocalGitProvider implements GitProvider, Disposable {
16681680 }
16691681 return (
16701682 log ??
1671- this . getLog ( repoPath , { all : options ?. mode !== 'single' , ordering : 'date' , limit : options ?. limit } )
1683+ this . getLog ( repoPath , {
1684+ all : options ?. mode !== 'single' ,
1685+ ordering : 'date' ,
1686+ limit : options ?. limit ,
1687+ stdin : stdin ,
1688+ } )
16721689 ) ;
16731690 }
16741691
16751692 getLogForRefFn = getLogForRef ;
16761693 }
16771694
1678- const [ logResult , stashResult , remotesResult ] = await Promise . allSettled ( [
1695+ const [ logResult , remotesResult ] = await Promise . allSettled ( [
16791696 getLogForRefFn ?. call ( this ) ??
1680- this . getLog ( repoPath , { all : options ?. mode !== 'single' , ordering : 'date' , limit : options ?. limit } ) ,
1681- this . getStash ( repoPath ) ,
1697+ this . getLog ( repoPath , {
1698+ all : options ?. mode !== 'single' ,
1699+ ordering : 'date' ,
1700+ limit : options ?. limit ,
1701+ stdin : stdin ,
1702+ } ) ,
16821703 this . getRemotes ( repoPath ) ,
16831704 ] ) ;
16841705
16851706 return this . getCommitsForGraphCore (
16861707 repoPath ,
16871708 asWebviewUri ,
16881709 getSettledValue ( logResult ) ,
1689- getSettledValue ( stashResult ) ,
1710+ stash ,
16901711 getSettledValue ( remotesResult ) ,
16911712 options ,
16921713 ) ;
@@ -2326,6 +2347,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
23262347 since ?: number | string ;
23272348 until ?: number | string ;
23282349 extraArgs ?: string [ ] ;
2350+ stdin ?: string ;
23292351 } ,
23302352 ) : Promise < GitLog | undefined > {
23312353 const scope = getLogScope ( ) ;
@@ -2386,7 +2408,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
23862408 args . push ( `-n${ limit + 1 } ` ) ;
23872409 }
23882410
2389- const data = await this . git . log2 ( repoPath , options ?. ref , ...args ) ;
2411+ const data = await this . git . log2 ( repoPath , options ?. ref , options ?. stdin , ...args ) ;
23902412
23912413 // const parser = GitLogParser.defaultParser;
23922414
0 commit comments