Skip to content

Commit c085d97

Browse files
fix
1 parent e317407 commit c085d97

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/backend/src/git.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ export const cloneRepository = async (
1818
path,
1919
})
2020

21-
await git.init(/*bare = */ true);
22-
23-
await git.fetch([
21+
await git.clone(
2422
remoteUrl.toString(),
25-
// See https://git-scm.com/book/en/v2/Git-Internals-The-Refspec
26-
"+refs/heads/*:refs/heads/*",
27-
"--progress",
28-
]);
23+
path,
24+
[
25+
"--bare",
26+
]
27+
);
28+
29+
await unsetGitConfig(path, ["remote.origin.url"]);
30+
31+
await git.cwd({
32+
path,
33+
}).addConfig("remote.origin.fetch", "+refs/heads/*:refs/heads/*");
2934
} catch (error: unknown) {
3035
const baseLog = `Failed to clone repository: ${path}`;
3136

@@ -54,7 +59,6 @@ export const fetchRepository = async (
5459

5560
await git.fetch([
5661
remoteUrl.toString(),
57-
"+refs/heads/*:refs/heads/*",
5862
"--prune",
5963
"--progress"
6064
]);

0 commit comments

Comments
 (0)