Sfoglia il codice sorgente

Fixes issues with repo change detection

main
Eric Amodio 4 anni fa
parent
commit
ce7006ac80
7 ha cambiato i file con 21 aggiunte e 8 eliminazioni
  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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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 Vedi File

@ -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);

Caricamento…
Annulla
Salva