We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 397c430 commit 4f9cb67Copy full SHA for 4f9cb67
packages/backend/src/git.ts
@@ -78,10 +78,6 @@ export const fetchRepository = async (
78
"--prune",
79
"--progress"
80
]);
81
-
82
- if (authHeader) {
83
- await git.raw(["config", "--unset", "http.extraHeader", authHeader]);
84
- }
85
} catch (error: unknown) {
86
const baseLog = `Failed to fetch repository: ${path}`;
87
if (env.SOURCEBOT_LOG_LEVEL !== "debug") {
@@ -92,6 +88,16 @@ export const fetchRepository = async (
92
88
} else {
93
89
throw new Error(`${baseLog}. Error: ${error}`);
94
90
}
91
+ } finally {
+ if (authHeader) {
+ const git = simpleGit({
+ progress: onProgress,
95
+ }).cwd({
96
+ path: path,
97
+ })
98
+
99
+ await git.raw(["config", "--unset", "http.extraHeader", authHeader]);
100
+ }
101
102
103
0 commit comments