瀏覽代碼

Fixes issues with repo change detection

main
Eric Amodio 4 年之前
父節點
當前提交
ce7006ac80
共有 7 個檔案被更改,包括 21 行新增8 行删除
  1. +2
    -0
      src/git/models/repository.ts
  2. +5
    -1
      src/views/branchesView.ts
  3. +1
    -1
      src/views/contributorsView.ts
  4. +10
    -3
      src/views/historyView.ts
  5. +1
    -1
      src/views/remotesView.ts
  6. +1
    -1
      src/views/stashesView.ts
  7. +1
    -1
      src/views/tagsView.ts

+ 2
- 0
src/git/models/repository.ts 查看文件

@ -199,6 +199,7 @@ export class Repository implements Disposable {
}
if (uri.path.endsWith('.git/config')) {
this._branch = undefined;
this.resetRemotesCache();
this.fireChange(RepositoryChange.Config, RepositoryChange.Remotes);
@ -239,6 +240,7 @@ export class Repository implements Disposable {
return;
case 'remotes':
this._branch = undefined;
this.resetRemotesCache();
this.fireChange(RepositoryChange.Remotes);

+ 5
- 1
src/views/branchesView.ts 查看文件

@ -99,7 +99,11 @@ export class BranchesRepositoryNode extends SubscribeableViewNode
return;
}
if (e.changed(RepositoryChange.Heads)) {
if (
e.changed(RepositoryChange.Config) ||
e.changed(RepositoryChange.Heads) ||
e.changed(RepositoryChange.Remotes)
) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);

+ 1
- 1
src/views/contributorsView.ts 查看文件

@ -69,7 +69,7 @@ export class ContributorsRepositoryNode extends SubscribeableViewNode
return;
}
if (e.changed(RepositoryChange.Heads)) {
if (e.changed(RepositoryChange.Config) || e.changed(RepositoryChange.Heads)) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);

+ 10
- 3
src/views/historyView.ts 查看文件

@ -116,7 +116,12 @@ export class HistoryRepositoryNode extends SubscribeableViewNode {
return;
}
if (e.changed(RepositoryChange.Index) || e.changed(RepositoryChange.Heads)) {
if (
e.changed(RepositoryChange.Config) ||
e.changed(RepositoryChange.Index) ||
e.changed(RepositoryChange.Heads) ||
e.changed(RepositoryChange.Remotes)
) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);
@ -153,8 +158,10 @@ export class HistoryViewNode extends ViewNode {
const branch = await child.repo.getBranch();
const status = branch?.getTrackingStatus();
this.view.titleContext =
branch != null ? `${branch.name}${status ? ` ${GlyphChars.Dot} ${status}` : ''}` : undefined;
this.view.title =
branch != null
? `${branch.name} Branch ${status ? ` ${GlyphChars.Dot} ${status}` : ''}`
: 'Current Branch';
return child.getChildren();
}

+ 1
- 1
src/views/remotesView.ts 查看文件

@ -96,7 +96,7 @@ export class RemotesRepositoryNode extends SubscribeableViewNode {
return;
}
if (e.changed(RepositoryChange.Remotes)) {
if (e.changed(RepositoryChange.Config) || e.changed(RepositoryChange.Remotes)) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);

+ 1
- 1
src/views/stashesView.ts 查看文件

@ -69,7 +69,7 @@ export class StashesRepositoryNode extends SubscribeableViewNode {
return;
}
if (e.changed(RepositoryChange.Heads)) {
if (e.changed(RepositoryChange.Config) || e.changed(RepositoryChange.Heads)) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);

+ 1
- 1
src/views/tagsView.ts 查看文件

@ -87,7 +87,7 @@ export class TagsRepositoryNode extends SubscribeableViewNode {
return;
}
if (e.changed(RepositoryChange.Tags)) {
if (e.changed(RepositoryChange.Config) || e.changed(RepositoryChange.Tags)) {
void this.triggerChange(true);
if (this.root) {
void this.parent?.triggerChange(true);

Loading…
取消
儲存