File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,30 +45,30 @@ const millisecondsPerHour = 60 * 60 * 1000;
4545const millisecondsPerDay = 24 * 60 * 60 * 1000 ;
4646
4747export const enum RepositoryChange {
48- // FileSystem = 'filesystem',
49- Unknown = 'unknown' ,
50-
51- // No file watching required
52- Closed = 'closed' ,
53- Ignores = 'ignores' ,
54- Starred = 'starred' ,
48+ Unknown = - 1 ,
5549
5650 // File watching required
57- CherryPick = 'cherrypick' ,
58- Config = 'config' ,
59- Heads = 'heads' ,
60- Index = 'index' ,
61- Merge = 'merge' ,
62- Rebase = 'rebase' ,
63- Remotes = 'remotes' ,
64- RemoteProviders = 'providers' ,
65- Stash = 'stash' ,
51+ Index = 0 ,
52+ Head = 1 ,
53+ Heads = 2 ,
54+ Tags = 3 ,
55+ Stash = 4 ,
56+ Remotes = 5 ,
57+ Worktrees = 6 ,
58+ Config = 7 ,
6659 /*
6760 * Union of Cherry, Merge, and Rebase
6861 */
69- Status = 'status' ,
70- Tags = 'tags' ,
71- Worktrees = 'worktrees' ,
62+ Status = 8 ,
63+ CherryPick = 9 ,
64+ Merge = 10 ,
65+ Rebase = 11 ,
66+
67+ // No file watching required
68+ Closed = 100 ,
69+ Ignores = 101 ,
70+ RemoteProviders = 102 ,
71+ Starred = 103 ,
7272}
7373
7474export const enum RepositoryChangeComparisonMode {
@@ -334,6 +334,10 @@ export class Repository implements Disposable {
334334 return ;
335335
336336 case 'HEAD' :
337+ this . resetCaches ( 'branches' ) ;
338+ this . fireChange ( RepositoryChange . Head , RepositoryChange . Heads ) ;
339+ return ;
340+
337341 case 'ORIG_HEAD' :
338342 this . resetCaches ( 'branches' ) ;
339343 this . fireChange ( RepositoryChange . Heads ) ;
Original file line number Diff line number Diff line change @@ -496,6 +496,7 @@ export class GraphWebview extends WebviewBase<State> {
496496 if (
497497 ! e . changed (
498498 RepositoryChange . Config ,
499+ RepositoryChange . Head ,
499500 RepositoryChange . Heads ,
500501 // RepositoryChange.Index,
501502 RepositoryChange . Remotes ,
@@ -511,7 +512,12 @@ export class GraphWebview extends WebviewBase<State> {
511512 return ;
512513 }
513514
514- this . updateState ( ) ;
515+ if ( e . changed ( RepositoryChange . Head , RepositoryChangeComparisonMode . Any ) ) {
516+ this . setSelectedRows ( undefined ) ;
517+ }
518+
519+ // Unless we don't know what changed, update the state immediately
520+ this . updateState ( ! e . changed ( RepositoryChange . Unknown , RepositoryChangeComparisonMode . Exclusive ) ) ;
515521 }
516522
517523 @debug ( { args : false } )
@@ -894,7 +900,7 @@ export class GraphWebview extends WebviewBase<State> {
894900 }
895901
896902 if ( this . _notifyDidChangeStateDebounced == null ) {
897- this . _notifyDidChangeStateDebounced = debounce ( this . notifyDidChangeState . bind ( this ) , 500 ) ;
903+ this . _notifyDidChangeStateDebounced = debounce ( this . notifyDidChangeState . bind ( this ) , 250 ) ;
898904 }
899905
900906 void this . _notifyDidChangeStateDebounced ( ) ;
You can’t perform that action at this time.
0 commit comments