mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
move unset to finally in fetch
This commit is contained in:
parent
397c430c5a
commit
4f9cb6701f
1 changed files with 10 additions and 4 deletions
|
|
@ -78,10 +78,6 @@ export const fetchRepository = async (
|
||||||
"--prune",
|
"--prune",
|
||||||
"--progress"
|
"--progress"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (authHeader) {
|
|
||||||
await git.raw(["config", "--unset", "http.extraHeader", authHeader]);
|
|
||||||
}
|
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const baseLog = `Failed to fetch repository: ${path}`;
|
const baseLog = `Failed to fetch repository: ${path}`;
|
||||||
if (env.SOURCEBOT_LOG_LEVEL !== "debug") {
|
if (env.SOURCEBOT_LOG_LEVEL !== "debug") {
|
||||||
|
|
@ -92,6 +88,16 @@ export const fetchRepository = async (
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`${baseLog}. Error: ${error}`);
|
throw new Error(`${baseLog}. Error: ${error}`);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (authHeader) {
|
||||||
|
const git = simpleGit({
|
||||||
|
progress: onProgress,
|
||||||
|
}).cwd({
|
||||||
|
path: path,
|
||||||
|
})
|
||||||
|
|
||||||
|
await git.raw(["config", "--unset", "http.extraHeader", authHeader]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue