Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure commits by others to a tracked upstream will update my graph (fix #234979) #235318

Closed
wants to merge 8 commits into from
8 changes: 7 additions & 1 deletion extensions/git/src/historyProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
icon: new ThemeIcon('cloud')
} : undefined;

// Base - compute only if the branch has changed
// Base - compute fully only if the branch has changed
if (this._HEAD?.name !== this.repository.HEAD.name) {
const mergeBase = await this.resolveHEADMergeBase();

Expand All @@ -140,6 +140,12 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
revision: mergeBase.commit,
icon: new ThemeIcon('cloud')
} : undefined;
} else if (this._currentHistoryItemBaseRef) {
// otherwise spot a newer commit
const revision = (await this.repository.getBranch(this._currentHistoryItemBaseRef.name)).commit;
if (revision && this._currentHistoryItemBaseRef.revision !== revision) {
this._currentHistoryItemBaseRef = { ...this._currentHistoryItemBaseRef, revision };
}
}
} else {
// Detached commit
Expand Down