@@ -110,7 +110,7 @@ import { countStringLength, filterMap } from '../../../system/array';
110
110
import { TimedCancellationSource } from '../../../system/cancellation' ;
111
111
import { gate } from '../../../system/decorators/gate' ;
112
112
import { 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' ;
114
114
import {
115
115
commonBaseIndex ,
116
116
dirname ,
@@ -1611,6 +1611,17 @@ export class LocalGitProvider implements GitProvider, Disposable {
1611
1611
) : Promise < GitGraph > {
1612
1612
const scope = getLogScope ( ) ;
1613
1613
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
+
1614
1625
let getLogForRefFn ;
1615
1626
if ( options ?. ref != null ) {
1616
1627
async function getLogForRef ( this : LocalGitProvider ) : Promise < GitLog | undefined > {
@@ -1626,6 +1637,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
1626
1637
ordering : 'date' ,
1627
1638
limit : 0 ,
1628
1639
extraArgs : [ `--since="${ Number ( commit . date ) } "` , '--boundary' ] ,
1640
+ stdin : stdin ,
1629
1641
} ) ;
1630
1642
1631
1643
let found = log ?. commits . has ( commit . sha ) ?? false ;
@@ -1668,25 +1680,34 @@ export class LocalGitProvider implements GitProvider, Disposable {
1668
1680
}
1669
1681
return (
1670
1682
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
+ } )
1672
1689
) ;
1673
1690
}
1674
1691
1675
1692
getLogForRefFn = getLogForRef ;
1676
1693
}
1677
1694
1678
- const [ logResult , stashResult , remotesResult ] = await Promise . allSettled ( [
1695
+ const [ logResult , remotesResult ] = await Promise . allSettled ( [
1679
1696
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
+ } ) ,
1682
1703
this . getRemotes ( repoPath ) ,
1683
1704
] ) ;
1684
1705
1685
1706
return this . getCommitsForGraphCore (
1686
1707
repoPath ,
1687
1708
asWebviewUri ,
1688
1709
getSettledValue ( logResult ) ,
1689
- getSettledValue ( stashResult ) ,
1710
+ stash ,
1690
1711
getSettledValue ( remotesResult ) ,
1691
1712
options ,
1692
1713
) ;
@@ -2326,6 +2347,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
2326
2347
since ?: number | string ;
2327
2348
until ?: number | string ;
2328
2349
extraArgs ?: string [ ] ;
2350
+ stdin ?: string ;
2329
2351
} ,
2330
2352
) : Promise < GitLog | undefined > {
2331
2353
const scope = getLogScope ( ) ;
@@ -2386,7 +2408,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
2386
2408
args . push ( `-n${ limit + 1 } ` ) ;
2387
2409
}
2388
2410
2389
- const data = await this . git . log2 ( repoPath , options ?. ref , ...args ) ;
2411
+ const data = await this . git . log2 ( repoPath , options ?. ref , options ?. stdin , ...args ) ;
2390
2412
2391
2413
// const parser = GitLogParser.defaultParser;
2392
2414
0 commit comments