Ver a proveniência

Fixes issues with repo change detection

main
Eric Amodio há 4 anos
ascendente
cometimento
ce7006ac80
7 ficheiros alterados com 21 adições e 8 eliminações
  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 Ver ficheiro

@ -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 Ver ficheiro

@ -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 Ver ficheiro

@ -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 Ver ficheiro

@ -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 Ver ficheiro

@ -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 Ver ficheiro

@ -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 Ver ficheiro

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

Carregando…
Cancelar
Guardar