mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +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",
|
||||
"--progress"
|
||||
]);
|
||||
|
||||
if (authHeader) {
|
||||
await git.raw(["config", "--unset", "http.extraHeader", authHeader]);
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
const baseLog = `Failed to fetch repository: ${path}`;
|
||||
if (env.SOURCEBOT_LOG_LEVEL !== "debug") {
|
||||
|
|
@ -92,6 +88,16 @@ export const fetchRepository = async (
|
|||
} else {
|
||||
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