╭ changed ───╮ │src/main.zig│ ╰────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │12 pub const RunOpts = struct { │ │13 out: *std.Io.Writer, │ │14 err: *std.Io.Writer, │ │15 + // the user's global git config, used for the commit identity in local mode.│ │16 + // null by default so tests and the server paths never read it. │ │17 + global_config_path: ?[]const u8 = null, │ │18 }; │ │19 │ │20 pub fn main(init: std.process.Init) !u8 { │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │38 │ │39 var stdout_writer = std.Io.File.stdout().writer(io, &.{}); │ │40 var stderr_writer = std.Io.File.stderr().writer(io, &.{}); │ │38 - const run_opts = RunOpts{ .out = &stdout_writer.interface, .err = &stderr_writer.interface };│ │41 + │ │42 + var environ_map = try std.process.Environ.createMap(init.minimal.environ, allocator); │ │43 + defer environ_map.deinit(); │ │44 + const global_config_path = try xit.config.globalConfigPath(io, allocator, &environ_map); │ │45 + defer if (global_config_path) |path| allocator.free(path); │ │46 + │ │47 + const run_opts = RunOpts{ │ │48 + .out = &stdout_writer.interface, │ │49 + .err = &stderr_writer.interface, │ │50 + .global_config_path = global_config_path, │ │51 + }; │ │52 │ │53 const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │54 defer allocator.free(cwd_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 }; │ │107 const found_len = if (found) |f| f.path.len else 0; │ │108 if (work_path.len > found_len) { │ │ 96 - found = .{ .path = try session_arena.allocator().dupe(u8, work_path), .repo_kind = probe_kind };│ │109 + found = .{ │ │110 + .path = try session_arena.allocator().dupe(u8, work_path), │ │111 + .repo_kind = probe_kind, │ │112 + .global_config_path = run_opts.global_config_path, │ │113 + }; │ │114 } │ │115 } else |err| switch (err) { │ │116 error.RepoNotFound => {}, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯