From 75f3da90edb66b81dbb6ed9806155f6bd7925fe1 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 21 Nov 2025 16:09:58 +0000 Subject: remove initial blank commit on bare repo creation we dont need it --- src/nostr/builder.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'src') diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index a0b82f4..259c380 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs @@ -73,40 +73,6 @@ impl Nip34WritePolicy { return Err(format!("git init failed: {}", stderr)); } - // Create an initial empty commit so the repository can be cloned - // This is required because git clone fails on completely empty repositories - let output = std::process::Command::new("git") - .args(&[ - "--git-dir", repo_path.to_str().unwrap(), - "commit-tree", "-m", "Initial empty commit", - "4b825dc642cb6eb9a060e54bf8d69288fbee4904" // Empty tree hash - ]) - .output() - .map_err(|e| format!("Failed to create initial commit: {}", e))?; - - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr); - tracing::warn!("Failed to create initial commit (repository may not be cloneable): {}", stderr); - // Don't fail here - the repository was created successfully - } else { - // Extract commit hash from stdout - let commit_hash = String::from_utf8_lossy(&output.stdout).trim().to_string(); - - // Create master branch pointing to this commit - let output = std::process::Command::new("git") - .args(&[ - "--git-dir", repo_path.to_str().unwrap(), - "update-ref", "refs/heads/master", &commit_hash - ]) - .output() - .map_err(|e| format!("Failed to create master branch: {}", e))?; - - if !output.status.success() { - let stderr = String::from_utf8_lossy(&output.stderr); - tracing::warn!("Failed to create master branch: {}", stderr); - } - } - tracing::info!("Created bare repository at {}", repo_path.display()); Ok(()) } -- cgit v1.2.3