Provide world Git identity, reflog fallback, object inspection, and which (T73)

This commit is contained in:
2026-11-08 02:28:34 +00:00
parent 1892642d8e
commit fdda49394f
11 changed files with 450 additions and 30 deletions
+9
View File
@@ -44,6 +44,7 @@ impl World {
/// Copy an optional bundle into a new world. Existing worlds retain their programs.
/// Each `.wasm` tool keeps its independent file and gains a relative `/bin/<name>` symlink.
/// `/dev` exposes generated null, zero, and random byte devices in every world.
/// Missing `/etc/gitconfig` defaults to Sausage <sausage@localhost>. Local repository config overrides it.
pub fn open_with_userland(dir: &Path, userland: Option<&Path>) -> anyhow::Result<Self> {
let root_dir = dir.join("world");
let host_dir = dir.join("host");
@@ -64,6 +65,14 @@ impl World {
}
}
}
let gitconfig = root_dir.join("etc/gitconfig");
if !gitconfig.try_exists()? {
std::fs::create_dir_all(root_dir.join("etc"))?;
std::fs::write(
gitconfig,
"[user]\n\tname = Sausage\n\temail = sausage@localhost\n",
)?;
}
std::fs::create_dir_all(&host_dir)?;
let mut mounts = Mounts::default();
mounts.mount(