Skip to content

Commit 2241217

Browse files
fix(worker): First check keys before unsetting them
1 parent 2b423ba commit 2241217

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/backend/src/git.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ export const unsetGitConfig = async (path: string, keys: string[], onProgress?:
105105
}).cwd(path);
106106

107107
try {
108+
const configList = await git.listConfig();
109+
const setKeys = Object.keys(configList.all);
110+
108111
for (const key of keys) {
109-
await git.raw(['config', '--unset', key]);
112+
if (setKeys.includes(key)) {
113+
await git.raw(['config', '--unset', key]);
114+
}
110115
}
111116
} catch (error: unknown) {
112117
if (error instanceof Error) {

0 commit comments

Comments
 (0)