|
|
@ -404,6 +404,7 @@ class GitConfigStateReal(GitConfigStateBase):
|
|
|
|
args = ['config', f'--{scope}', '--replace-all', key, value]
|
|
|
|
args = ['config', f'--{scope}', '--replace-all', key, value]
|
|
|
|
if value_pattern is not None:
|
|
|
|
if value_pattern is not None:
|
|
|
|
args.append(value_pattern)
|
|
|
|
args.append(value_pattern)
|
|
|
|
|
|
|
|
with self._scope_lock(scope):
|
|
|
|
GIT.Capture(args, cwd=self.root)
|
|
|
|
GIT.Capture(args, cwd=self.root)
|
|
|
|
|
|
|
|
|
|
|
|
def unset_config(self, key: str, *, scope: GitConfigScope,
|
|
|
|
def unset_config(self, key: str, *, scope: GitConfigScope,
|
|
|
@ -411,6 +412,7 @@ class GitConfigStateReal(GitConfigStateBase):
|
|
|
|
# NOTE: `git config` already canonicalizes key.
|
|
|
|
# NOTE: `git config` already canonicalizes key.
|
|
|
|
accepted_retcodes = (0, 5) if missing_ok else (0, )
|
|
|
|
accepted_retcodes = (0, 5) if missing_ok else (0, )
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
|
|
|
|
with self._scope_lock(scope):
|
|
|
|
GIT.Capture(['config', f'--{scope}', '--unset', key],
|
|
|
|
GIT.Capture(['config', f'--{scope}', '--unset', key],
|
|
|
|
cwd=self.root,
|
|
|
|
cwd=self.root,
|
|
|
|
accepted_retcodes=accepted_retcodes)
|
|
|
|
accepted_retcodes=accepted_retcodes)
|
|
|
@ -429,6 +431,7 @@ class GitConfigStateReal(GitConfigStateBase):
|
|
|
|
if value_pattern is not None:
|
|
|
|
if value_pattern is not None:
|
|
|
|
args.append(value_pattern)
|
|
|
|
args.append(value_pattern)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
|
|
|
|
with self._scope_lock(scope):
|
|
|
|
GIT.Capture(args,
|
|
|
|
GIT.Capture(args,
|
|
|
|
cwd=self.root,
|
|
|
|
cwd=self.root,
|
|
|
|
accepted_retcodes=accepted_retcodes)
|
|
|
|
accepted_retcodes=accepted_retcodes)
|
|
|
|