Ver código fonte

Fixes issues with repo change detection

main
Eric Amodio 4 anos atrás
pai
commit
ce7006ac80
7 arquivos alterados com 21 adições e 8 exclusõ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 arquivo

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

+ 5
- 1
src/views/branchesView.ts Ver arquivo

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

+ 1
- 1
src/views/contributorsView.ts Ver arquivo

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

+ 10
- 3
src/views/historyView.ts Ver arquivo

@ -116,7 +116,12 @@ export class HistoryRepositoryNode extends SubscribeableViewNode {
return; 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); void this.triggerChange(true);
if (this.root) { if (this.root) {
void this.parent?.triggerChange(true); void this.parent?.triggerChange(true);
@ -153,8 +158,10 @@ export class HistoryViewNode extends ViewNode {
const branch = await child.repo.getBranch(); const branch = await child.repo.getBranch();
const status = branch?.getTrackingStatus(); 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(); return child.getChildren();
} }

+ 1
- 1
src/views/remotesView.ts Ver arquivo

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

+ 1
- 1
src/views/stashesView.ts Ver arquivo

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

+ 1
- 1
src/views/tagsView.ts Ver arquivo

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

Carregando…
Cancelar
Salvar