Git - fix readOnly for the Config operation (#197918)

This commit is contained in:
Ladislau Szomoru 2023-11-10 15:05:39 +01:00 committed by GitHub
parent c295f473c0
commit 2095b6f5a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -137,7 +137,7 @@ export const Operation = {
CheckoutTracking: (refLabel: string) => ({ kind: OperationKind.CheckoutTracking, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true, refLabel } as CheckoutTrackingOperation),
Clean: (showProgress: boolean) => ({ kind: OperationKind.Clean, blocking: false, readOnly: false, remote: false, retry: false, showProgress } as CleanOperation),
Commit: { kind: OperationKind.Commit, blocking: true, readOnly: false, remote: false, retry: false, showProgress: true } as CommitOperation,
Config: { kind: OperationKind.Config, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as ConfigOperation,
Config: (readOnly: boolean) => ({ kind: OperationKind.Config, blocking: false, readOnly, remote: false, retry: false, showProgress: true } as ConfigOperation),
DeleteBranch: { kind: OperationKind.DeleteBranch, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteBranchOperation,
DeleteRef: { kind: OperationKind.DeleteRef, blocking: false, readOnly: false, remote: false, retry: false, showProgress: true } as DeleteRefOperation,
DeleteRemoteTag: { kind: OperationKind.DeleteRemoteTag, blocking: false, readOnly: false, remote: true, retry: false, showProgress: true } as DeleteRemoteTagOperation,

View file

@ -1113,19 +1113,19 @@ export class Repository implements Disposable {
}
getConfigs(): Promise<{ key: string; value: string }[]> {
return this.run(Operation.Config, () => this.repository.getConfigs('local'));
return this.run(Operation.Config(true), () => this.repository.getConfigs('local'));
}
getConfig(key: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('local', key));
return this.run(Operation.Config(true), () => this.repository.config('local', key));
}
getGlobalConfig(key: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('global', key));
return this.run(Operation.Config(true), () => this.repository.config('global', key));
}
setConfig(key: string, value: string): Promise<string> {
return this.run(Operation.Config, () => this.repository.config('local', key, value));
return this.run(Operation.Config(false), () => this.repository.config('local', key, value));
}
log(options?: LogOptions): Promise<Commit[]> {