This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
lib/models/repository-states Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,9 +103,12 @@ export default class Present extends State {
103103 return true ;
104104 }
105105
106- acceptInvalidation ( spec ) {
106+ acceptInvalidation ( spec , { globally } = { } ) {
107107 this . cache . invalidate ( spec ( ) ) ;
108108 this . didUpdate ( ) ;
109+ if ( globally ) {
110+ this . didGloballyInvalidate ( spec ) ;
111+ }
109112 }
110113
111114 invalidateCacheAfterFilesystemChange ( events ) {
@@ -524,6 +527,7 @@ export default class Present extends State {
524527 return this . invalidate (
525528 ( ) => Keys . config . eachWithSetting ( setting ) ,
526529 ( ) => this . git ( ) . setConfig ( setting , value , options ) ,
530+ { globally : options . global } ,
527531 ) ;
528532 }
529533
@@ -931,14 +935,14 @@ export default class Present extends State {
931935 return this . cache ;
932936 }
933937
934- invalidate ( spec , body ) {
938+ invalidate ( spec , body , options = { } ) {
935939 return body ( ) . then (
936940 result => {
937- this . acceptInvalidation ( spec ) ;
941+ this . acceptInvalidation ( spec , options ) ;
938942 return result ;
939943 } ,
940944 err => {
941- this . acceptInvalidation ( spec ) ;
945+ this . acceptInvalidation ( spec , options ) ;
942946 return Promise . reject ( err ) ;
943947 } ,
944948 ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import RemoteSet from '../remote-set';
55import { nullOperationStates } from '../operation-states' ;
66import MultiFilePatch from '../patch/multi-file-patch' ;
77import CompositeGitStrategy from '../../composite-git-strategy' ;
8+ import { Keys } from './cache/keys' ;
89
910/**
1011 * Map of registered subclasses to allow states to transition to one another without circular dependencies.
@@ -215,6 +216,9 @@ export default class State {
215216 async setConfig ( optionName , value , options ) {
216217 await this . workdirlessGit ( ) . setConfig ( optionName , value , options ) ;
217218 this . didUpdate ( ) ;
219+ if ( options . global ) {
220+ this . didGloballyInvalidate ( ( ) => Keys . config . eachWithSetting ( optionName ) ) ;
221+ }
218222 }
219223
220224 unsetConfig ( option ) {
You can’t perform that action at this time.
0 commit comments