Skip to content

Commit c5a921f

Browse files
committed
cleanup authheader usage
1 parent c40576d commit c5a921f

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

packages/backend/src/git.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,12 @@ export const cloneRepository = async (
2626
path,
2727
})
2828

29-
if (authHeader) {
30-
await git.clone(
31-
cloneUrl,
32-
path,
33-
[
34-
"--bare",
35-
"-c",
36-
`http.extraHeader=${authHeader}`,
37-
]
38-
)
39-
} else {
40-
await git.clone(
41-
cloneUrl,
42-
path,
43-
[
44-
"--bare",
45-
]
46-
)
47-
}
29+
const cloneArgs = [
30+
"--bare",
31+
...(authHeader ? ["-c", `http.extraHeader=${authHeader}`] : [])
32+
];
33+
34+
await git.clone(cloneUrl, path, cloneArgs);
4835

4936
await unsetGitConfig(path, ["remote.origin.url"]);
5037
} catch (error: unknown) {

0 commit comments

Comments
 (0)