@@ -2435,9 +2435,9 @@ export class LocalGitProvider implements GitProvider, Disposable {
2435
2435
let stdin : string | undefined ;
2436
2436
2437
2437
// TODO@eamodio this is insanity -- there *HAS* to be a better way to get git log to return stashes
2438
- const stash = getSettledValue ( stashResult ) ;
2439
- if ( stash ?. commits . size ) {
2440
- stashes = new Map ( stash . commits ) ;
2438
+ const gitStash = getSettledValue ( stashResult ) ;
2439
+ if ( gitStash ?. stashes . size ) {
2440
+ stashes = new Map ( gitStash . stashes ) ;
2441
2441
stdin = join (
2442
2442
map ( stashes . values ( ) , c => c . sha . substring ( 0 , 9 ) ) ,
2443
2443
'\n' ,
@@ -2574,7 +2574,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
2574
2574
let remote : GitRemote | undefined ;
2575
2575
let remoteBranchId : string ;
2576
2576
let remoteName : string ;
2577
- let stashCommit : GitStashCommit | undefined ;
2577
+ let stash : GitStashCommit | undefined ;
2578
2578
let stats : GitGraphRowsStats | undefined ;
2579
2579
let tagId : string ;
2580
2580
let tagName : string ;
@@ -2778,7 +2778,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
2778
2778
}
2779
2779
}
2780
2780
2781
- stashCommit = stash ?. commits . get ( commit . sha ) ;
2781
+ stash = gitStash ?. stashes . get ( commit . sha ) ;
2782
2782
2783
2783
parents = commit . parents ? commit . parents . split ( ' ' ) : [ ] ;
2784
2784
if ( reachableFromHEAD . has ( commit . sha ) ) {
@@ -2788,15 +2788,15 @@ export class LocalGitProvider implements GitProvider, Disposable {
2788
2788
}
2789
2789
2790
2790
// Remove the second & third parent, if exists, from each stash commit as it is a Git implementation for the index and untracked files
2791
- if ( stashCommit != null && parents . length > 1 ) {
2791
+ if ( stash != null && parents . length > 1 ) {
2792
2792
// Remap the "index commit" (e.g. contains staged files) of the stash
2793
2793
remappedIds . set ( parents [ 1 ] , commit . sha ) ;
2794
2794
// Remap the "untracked commit" (e.g. contains untracked files) of the stash
2795
2795
remappedIds . set ( parents [ 2 ] , commit . sha ) ;
2796
2796
parents . splice ( 1 , 2 ) ;
2797
2797
}
2798
2798
2799
- if ( stashCommit == null && ! avatars . has ( commit . authorEmail ) ) {
2799
+ if ( stash == null && ! avatars . has ( commit . authorEmail ) ) {
2800
2800
avatarUri = getCachedAvatarUri ( commit . authorEmail ) ;
2801
2801
if ( avatarUri != null ) {
2802
2802
avatars . set ( commit . authorEmail , avatarUri . toString ( true ) ) ;
@@ -2805,16 +2805,16 @@ export class LocalGitProvider implements GitProvider, Disposable {
2805
2805
2806
2806
isCurrentUser = isUserMatch ( currentUser , commit . author , commit . authorEmail ) ;
2807
2807
2808
- if ( stashCommit != null ) {
2808
+ if ( stash != null ) {
2809
2809
contexts . row = serializeWebviewItemContext < GraphItemRefContext > ( {
2810
2810
webviewItem : 'gitlens:stash' ,
2811
2811
webviewItemValue : {
2812
2812
type : 'stash' ,
2813
2813
ref : createReference ( commit . sha , repoPath , {
2814
2814
refType : 'stash' ,
2815
- name : stashCommit . name ,
2816
- message : stashCommit . message ,
2817
- number : stashCommit . number ,
2815
+ name : stash . name ,
2816
+ message : stash . message ,
2817
+ number : stash . number ,
2818
2818
} ) ,
2819
2819
} ,
2820
2820
} ) ;
@@ -2852,7 +2852,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
2852
2852
date : Number ( ordering === 'author-date' ? commit . authorDate : commit . committerDate ) * 1000 ,
2853
2853
message : emojify ( commit . message . trim ( ) ) ,
2854
2854
// TODO: review logic for stash, wip, etc
2855
- type : stashCommit != null ? 'stash-node' : parents . length > 1 ? 'merge-node' : 'commit-node' ,
2855
+ type : stash != null ? 'stash-node' : parents . length > 1 ? 'merge-node' : 'commit-node' ,
2856
2856
heads : refHeads ,
2857
2857
remotes : refRemoteHeads ,
2858
2858
tags : refTags ,
@@ -4996,8 +4996,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
4996
4996
async getStash ( repoPath : string | undefined ) : Promise < GitStash | undefined > {
4997
4997
if ( repoPath == null ) return undefined ;
4998
4998
4999
- let stash = this . useCaching ? this . _stashesCache . get ( repoPath ) : undefined ;
5000
- if ( stash === undefined ) {
4999
+ let gitStash = this . useCaching ? this . _stashesCache . get ( repoPath ) : undefined ;
5000
+ if ( gitStash === undefined ) {
5001
5001
const parser = createLogParserWithFiles < {
5002
5002
sha : string ;
5003
5003
date : string ;
@@ -5018,10 +5018,9 @@ export class LocalGitProvider implements GitProvider, Disposable {
5018
5018
similarityThreshold : configuration . get ( 'advanced.similarityThreshold' ) ,
5019
5019
} ) ;
5020
5020
5021
- const commits = new Map < string , GitStashCommit > ( ) ;
5021
+ const stashes = new Map < string , GitStashCommit > ( ) ;
5022
5022
5023
- const stashes = parser . parse ( data ) ;
5024
- for ( const s of stashes ) {
5023
+ for ( const s of parser . parse ( data ) ) {
5025
5024
let onRef ;
5026
5025
let summary ;
5027
5026
let message ;
@@ -5042,7 +5041,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
5042
5041
message = s . summary . trim ( ) ;
5043
5042
}
5044
5043
5045
- commits . set (
5044
+ stashes . set (
5046
5045
s . sha ,
5047
5046
new GitCommit (
5048
5047
this . container ,
@@ -5065,14 +5064,14 @@ export class LocalGitProvider implements GitProvider, Disposable {
5065
5064
) ;
5066
5065
}
5067
5066
5068
- stash = { repoPath : repoPath , commits : commits } ;
5067
+ gitStash = { repoPath : repoPath , stashes : stashes } ;
5069
5068
5070
5069
if ( this . useCaching ) {
5071
- this . _stashesCache . set ( repoPath , stash ?? null ) ;
5070
+ this . _stashesCache . set ( repoPath , gitStash ?? null ) ;
5072
5071
}
5073
5072
}
5074
5073
5075
- return stash ?? undefined ;
5074
+ return gitStash ?? undefined ;
5076
5075
}
5077
5076
5078
5077
@log ( )
@@ -5558,15 +5557,15 @@ export class LocalGitProvider implements GitProvider, Disposable {
5558
5557
5559
5558
if ( shas == null ) {
5560
5559
// TODO@eamodio this is insanity -- there *HAS* to be a better way to get git log to return stashes
5561
- const stash = await this . getStash ( repoPath ) ;
5562
- if ( stash ?. commits . size ) {
5560
+ const gitStash = await this . getStash ( repoPath ) ;
5561
+ if ( gitStash ?. stashes . size ) {
5563
5562
stdin = '' ;
5564
- stashes = new Map ( stash . commits ) ;
5565
- for ( const commit of stash . commits . values ( ) ) {
5566
- stdin += `${ commit . sha . substring ( 0 , 9 ) } \n` ;
5563
+ stashes = new Map ( gitStash . stashes ) ;
5564
+ for ( const stash of gitStash . stashes . values ( ) ) {
5565
+ stdin += `${ stash . sha . substring ( 0 , 9 ) } \n` ;
5567
5566
// Include the stash's 2nd (index files) and 3rd (untracked files) parents
5568
- for ( const p of skip ( commit . parents , 1 ) ) {
5569
- stashes . set ( p , commit ) ;
5567
+ for ( const p of skip ( stash . parents , 1 ) ) {
5568
+ stashes . set ( p , stash ) ;
5570
5569
stdin += `${ p . substring ( 0 , 9 ) } \n` ;
5571
5570
}
5572
5571
}
@@ -5702,15 +5701,15 @@ export class LocalGitProvider implements GitProvider, Disposable {
5702
5701
let stdin : string | undefined ;
5703
5702
5704
5703
// TODO@eamodio this is insanity -- there *HAS* to be a better way to get git log to return stashes
5705
- const stash = await this . getStash ( repoPath ) ;
5706
- if ( stash ?. commits . size ) {
5704
+ const gitStash = await this . getStash ( repoPath ) ;
5705
+ if ( gitStash ?. stashes . size ) {
5707
5706
stdin = '' ;
5708
- stashes = new Map ( stash . commits ) ;
5709
- for ( const commit of stash . commits . values ( ) ) {
5710
- stdin += `${ commit . sha . substring ( 0 , 9 ) } \n` ;
5707
+ stashes = new Map ( gitStash . stashes ) ;
5708
+ for ( const stash of gitStash . stashes . values ( ) ) {
5709
+ stdin += `${ stash . sha . substring ( 0 , 9 ) } \n` ;
5711
5710
// Include the stash's 2nd (index files) and 3rd (untracked files) parents
5712
- for ( const p of skip ( commit . parents , 1 ) ) {
5713
- stashes . set ( p , commit ) ;
5711
+ for ( const p of skip ( stash . parents , 1 ) ) {
5712
+ stashes . set ( p , stash ) ;
5714
5713
stdin += `${ p . substring ( 0 , 9 ) } \n` ;
5715
5714
}
5716
5715
}
0 commit comments