╭ changed ──────╮ │src/command.zig│ ╰───────────────╯ ╭───────────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const srv = @import("./serve.zig"); │ │3 -const ssh = @import("./ssh_helper.zig");│ │3 +const ssh = @import("./ssh_git.zig"); │ │4 │ │5 pub const CommandKind = enum { │ │6 serve, │ ╰───────────────────────────────────────────╯ ╭─────────────────────────╮ │ 7 - ssh_helper, │ │ 7 + ssh_git, │ │ 8 }; │ │ 9 │ │10 const Help = struct {│ ╰─────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │24 \\haxy serve --http-listen 127.0.0.1:8080 --ssh-listen 127.0.0.1:8081 --wui-listen 127.0.0.1:8082 --data-dir /srv/git│ │25 , │ │26 }, │ │27 - .ssh_helper => .{ │ │28 - .name = "ssh-helper", │ │27 + .ssh_git => .{ │ │28 + .name = "ssh-git", │ │29 .descrip = │ │30 \\a helper run by sshd that forwards Git SSH service requests to serve. │ │31 , │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │32 .example = │ │33 - \\haxy ssh-helper --ssh-connect 127.0.0.1:8081 --service upload-pack <directory>│ │33 + \\haxy ssh-git --ssh-connect 127.0.0.1:8081 --service upload-pack <directory> │ │34 , │ │35 }, │ │36 }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │190 /// if any additional allocation needs to be done, the arena inside the cmd args will be used.│ │191 pub const Command = union(CommandKind) { │ │192 serve: srv.Options, │ │193 - ssh_helper: ssh.Options, │ │193 + ssh_git: ssh.Options, │ │194 │ │195 pub fn initMaybe(cmd_args: *CommandArgs) !?Command { │ │196 const command_kind = cmd_args.command_kind orelse return null; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │215 │ │216 return .{ .serve = options }; │ │217 }, │ │218 - .ssh_helper => { │ │218 + .ssh_git => { │ │219 if (cmd_args.positional_args.len > 1) return null;│ │220 │ │221 var options: ssh.Options = .{}; │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │228 } │ │229 options.dir = if (cmd_args.positional_args.len == 1) cmd_args.positional_args[0] else null;│ │230 │ │231 - return .{ .ssh_helper = options }; │ │231 + return .{ .ssh_git = options }; │ │232 }, │ │233 } │ │234 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───╮ │src/main.zig│ ╰────────────╯ ╭────────────────────────────────────────────╮ │ 4 const rp = xit.repo; │ │ 5 const cmd = @import("./command.zig"); │ │ 6 const srv = @import("./serve.zig"); │ │ 7 -const ssh = @import("./ssh_helper.zig");│ │ 7 +const ssh = @import("./ssh_git.zig"); │ │ 8 │ │ 9 pub const RunOpts = struct { │ │10 out: *std.Io.Writer, │ ╰────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │78 .help => |cmd_kind_maybe| try cmd.printHelp(cmd_kind_maybe, run_opts.out), │ │79 .cli => |cli_cmd| switch (cli_cmd) { │ │80 .serve => |options| try srv.run(repo_kind, any_repo_opts, io, allocator, cwd_path, options, run_opts.err, {}),│ │81 - .ssh_helper => |options| try ssh.run(io, allocator, options, run_opts.environ_map), │ │81 + .ssh_git => |options| try ssh.run(io, allocator, options, run_opts.environ_map), │ │82 }, │ │83 } │ │84 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │src/serve.zig│ ╰─────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │497 │ │498 fn readSshRequest(allocator: std.mem.Allocator, reader: *std.Io.Reader) !SshRequest { │ │499 const magic = try readSshPreludeLine(reader); │ │500 - if (!std.mem.eql(u8, magic, "haxy-ssh-helper-v1")) return error.InvalidSshMagic; │ │500 + if (!std.mem.eql(u8, magic, "haxy-ssh-git-v1")) return error.InvalidSshMagic; │ │501 │ │502 const service_line = try readSshPreludeLine(reader); │ │503 const service = parseSshService(stripPrefix(service_line, "service=") orelse return error.InvalidSshServiceLine) orelse return error.InvalidSshService;│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯