]> quire.kejadlen.dev Git - quire.git/commitdiff
Set initial branch to main when creating bare repos
authorAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 15:15:06 +0000 (15:15 +0000)
committerAlpha Chen <alpha@kejadlen.dev>
Mon, 27 Apr 2026 15:25:54 +0000 (08:25 -0700)
Without --initial-branch, git defaults to master, which mismatches
the push command that explicitly pushes main.

Assisted-by: GLM-5.1 via pi
src/bin/quire/commands/repo.rs
src/quire.rs

index 557c59cd0c65ddd519ba05bad1f104b48808bb0b..eacece8f9297166add7d1cba7e479e300ac0ce62 100644 (file)
@@ -14,7 +14,7 @@ pub async fn new(quire: &Quire, name: &str) -> Result<()> {
     }
 
     let status = Command::new("git")
-        .args(["init", "--bare", name])
+        .args(["init", "--bare", "--initial-branch=main", name])
         .current_dir(quire.repos_dir())
         .status()
         .into_diagnostic()?;
index 43485851259f6787a11e71e331a7e0ab1dd772c4..398fe6693bd5b61ce465295884539856bb2a8ccf 100644 (file)
@@ -387,7 +387,7 @@ mod tests {
             output
         };
 
-        git(&["init", "--bare"]);
+        git(&["init", "--bare", "-b", "main"]);
 
         let repo = Repo { path: bare };