mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
fix(worker): First check keys before unsetting them
This commit is contained in:
parent
2b423ba7e9
commit
2241217b0b
1 changed files with 6 additions and 1 deletions
|
|
@ -105,8 +105,13 @@ export const unsetGitConfig = async (path: string, keys: string[], onProgress?:
|
||||||
}).cwd(path);
|
}).cwd(path);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const configList = await git.listConfig();
|
||||||
|
const setKeys = Object.keys(configList.all);
|
||||||
|
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
await git.raw(['config', '--unset', key]);
|
if (setKeys.includes(key)) {
|
||||||
|
await git.raw(['config', '--unset', key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue