Provide world Git identity, reflog fallback, object inspection, and which (T73)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user