╭ changed ───╮ │src/main.zig│ ╰────────────╯ ╭────────────────────────────────────────────────────────────╮ │19 _ = debug_allocator.deinit(); │ │20 }; │ │21 │ │22 - var threaded = std.Io.Threaded.init(allocator, .{});│ │22 + var threaded = std.Io.Threaded.init(allocator, .{ │ │23 + .environ = init.minimal.environ, │ │24 + }); │ │25 defer threaded.deinit(); │ │26 const io = threaded.io(); │ │27 │ ╰────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │179 } │ │180 │ │181 // create sshd_config file │ │182 + const sshd_config_str = blk: { │ │183 + // SetEnv PATH=... allows us to propagate the test process's PATH │ │184 + // to the spawned login shell (in sshd). │ │185 + // │ │186 + // without it, shells that don't auto-resource PATH on startup (e.g. nushell │ │187 + // on NixOS) through /etc/set-environment will fail to find │ │188 + // git-upload-pack / git-receive-pack. │ │189 + const base_config = │ │190 + \\AuthenticationMethods publickey │ │191 + \\PubkeyAuthentication yes │ │192 + \\PasswordAuthentication no │ │193 + \\StrictModes no │ │194 + //SetEnv PATH={s} -- if we find $PATH defined. │ │195 + ; │ │196 + var env_map = try std.process.Environ.createMap(std.testing.io_instance.environ.process_environ, allocator);│ │197 + defer env_map.deinit(); │ │198 + │ │199 + const config_str = if (env_map.get("PATH")) |path_str| │ │200 + try std.fmt.allocPrint(allocator, "{s}\n" ++ "SetEnv PATH={s}\n", .{ base_config, path_str }) │ │201 + else │ │202 + try std.fmt.allocPrint(allocator, "{s}", .{base_config}); │ │203 + │ │204 + break :blk config_str; │ │205 + }; │ │206 + defer allocator.free(sshd_config_str); │ │207 + │ │208 const sshd_config_file = try std.Io.Dir.cwd().createFile(io, temp_dir_name ++ "/sshd_config", .{}); │ │209 defer sshd_config_file.close(io); │ │184 - try sshd_config_file.writeStreamingAll(io, │ │185 - \\AuthenticationMethods publickey │ │186 - \\PubkeyAuthentication yes │ │187 - \\PasswordAuthentication no │ │188 - \\StrictModes no │ │189 - \\ │ │190 - ); │ │210 + try sshd_config_file.writeStreamingAll(io, sshd_config_str); │ │211 if (.windows != builtin.os.tag) { │ │212 try sshd_config_file.setPermissions(io, @enumFromInt(0o600)); │ │213 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯