File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,15 @@ export class CreatePullRequestDataModel {
133133 public async gitFiles ( ) : Promise < Change [ ] > {
134134 await this . _constructed ;
135135 if ( this . _gitFiles === undefined ) {
136- this . _gitFiles = await this . folderRepositoryManager . repository . diffBetween ( this . _baseBranch , this . _compareBranch ) ;
136+ const startBase = this . _baseBranch ;
137+ const startCompare = this . _compareBranch ;
138+ const result = await this . folderRepositoryManager . repository . diffBetween ( this . _baseBranch , this . _compareBranch ) ;
139+ if ( startBase !== this . _baseBranch || startCompare !== this . _compareBranch ) {
140+ // The branches have changed while we were waiting for the diff. We can use the result, but we shouldn't save it
141+ return result ;
142+ } else {
143+ this . _gitFiles = result ;
144+ }
137145 }
138146 return this . _gitFiles ;
139147 }
You can’t perform that action at this time.
0 commit comments