tiny.sql.decodeHistoryBranchUpstreamConfig
Defined in sync.
Source
Source: lib/sql/src/sync.zig:600
zig
pub fn decodeBranchUpstreamConfig(allocator: Allocator, bytes: []const u8) Error!BranchUpstreamConfig { var reader = BranchUpstreamConfigReader.init(bytes); if (try reader.readU32() != branch_upstream_config_magic) return error.InvalidBranchUpstreamConfig; if (try reader.readU32() != branch_upstream_config_format_version) return error.InvalidBranchUpstreamConfig; const count = try reader.readCount(); const upstreams = try allocator.alloc(BranchUpstreamEntry, count); var read: usize = 0; errdefer { for (upstreams[0..read]) |*upstream| upstream.deinit(allocator); if (upstreams.len != 0) allocator.free(upstreams); } for (upstreams) |*upstream| { const branch_name = try reader.readBytes(); const remote_name = try reader.readBytes(); const remote_branch_name = try reader.readBytes(); upstream.* = try BranchUpstreamEntry.init(allocator, branch_name, remote_name, remote_branch_name); read += 1; } try reader.finish(); try validateBranchUpstreamEntries(upstreams); return .{ .allocator = allocator, .upstreams = upstreams, };}Source: lib/sql/src/root.zig:121
zig
pub const decodeHistoryBranchUpstreamConfig = sync.decodeBranchUpstreamConfig;Complete call list
7 direct calls.
lib.sql.src.sync.BranchUpstreamConfigReader.finish[method] — private source atlib/sql/src/sync.zig:1606in nearest public ownertiny.sql.synclib.sql.src.sync.BranchUpstreamConfigReader.init[function] — private source atlib/sql/src/sync.zig:1602in nearest public ownertiny.sql.synclib.sql.src.sync.BranchUpstreamConfigReader.readBytes[method] — private source atlib/sql/src/sync.zig:1610in nearest public ownertiny.sql.synclib.sql.src.sync.BranchUpstreamConfigReader.readCount[method] — private source atlib/sql/src/sync.zig:1618in nearest public ownertiny.sql.synclib.sql.src.sync.BranchUpstreamConfigReader.readU32[method] — private source atlib/sql/src/sync.zig:1622in nearest public ownertiny.sql.synctiny.sql.sync.BranchUpstreamEntry.init[function] atlib/sql/src/sync.zig:191lib.sql.src.sync.validateBranchUpstreamEntries[function] — private source atlib/sql/src/sync.zig:1734in nearest public ownertiny.sql.sync
Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |