Skip to content

Commit fab6946

Browse files
christian-schillingLMG
authored andcommitted
Don't pack refs anymore
While ref packing makes iteration a bit faster, it causes contention when accessed concurrently, in particular when refs are deleted. Change-Id: no-packed-refs
1 parent 07a304b commit fab6946

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

josh-proxy/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ pub fn create_repo(path: &std::path::Path) -> josh::JoshResult<()> {
315315
shell.command("git config receive.advertisePushOptions true");
316316
let ce = std::env::current_exe().expect("can't find path to exe");
317317
shell.command("rm -Rf hooks");
318+
shell.command("rm -Rf *.lock");
319+
shell.command("rm -Rf packed-refs");
318320
shell.command("mkdir hooks");
319321
std::os::unix::fs::symlink(ce.clone(), path.join("hooks").join("update"))
320322
.expect("can't symlink update hook");
@@ -325,7 +327,6 @@ pub fn create_repo(path: &std::path::Path) -> josh::JoshResult<()> {
325327
.to_string(),
326328
);
327329
shell.command("git config gc.auto 0");
328-
shell.command("git pack-refs --all");
329330

330331
if std::env::var_os("JOSH_KEEP_NS") == None {
331332
std::fs::remove_dir_all(path.join("refs/namespaces")).ok();

0 commit comments

Comments
 (0)