File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -2770,8 +2770,25 @@ export class Repository implements Disposable {
2770
2770
return this . unpublishedCommits ;
2771
2771
}
2772
2772
2773
- if ( this . HEAD && this . HEAD . name && this . HEAD . upstream && this . HEAD . ahead && this . HEAD . ahead > 0 ) {
2774
- const ref1 = `${ this . HEAD . upstream . remote } /${ this . HEAD . upstream . name } ` ;
2773
+ if ( ! this . HEAD ?. name ) {
2774
+ this . unpublishedCommits = new Set < string > ( ) ;
2775
+ return this . unpublishedCommits ;
2776
+ }
2777
+
2778
+ if ( this . HEAD . upstream ) {
2779
+ // Upstream
2780
+ if ( this . HEAD . ahead === 0 ) {
2781
+ this . unpublishedCommits = new Set < string > ( ) ;
2782
+ } else {
2783
+ const ref1 = `${ this . HEAD . upstream . remote } /${ this . HEAD . upstream . name } ` ;
2784
+ const ref2 = this . HEAD . name ;
2785
+
2786
+ const revList = await this . repository . revList ( ref1 , ref2 ) ;
2787
+ this . unpublishedCommits = new Set < string > ( revList ) ;
2788
+ }
2789
+ } else if ( this . historyProvider . currentHistoryItemBaseRef ) {
2790
+ // Base
2791
+ const ref1 = this . historyProvider . currentHistoryItemBaseRef . id ;
2775
2792
const ref2 = this . HEAD . name ;
2776
2793
2777
2794
const revList = await this . repository . revList ( ref1 , ref2 ) ;
You can’t perform that action at this time.
0 commit comments