tiny.sql.HistoryBranchUpstreamConfig
Defined in sync.
API (5)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sql/src/sync.zig:215
zig
pub const BranchUpstreamConfig = struct { allocator: Allocator, upstreams: []BranchUpstreamEntry, pub fn init(allocator: Allocator, upstreams: []const BranchUpstreamEntry) Error!BranchUpstreamConfig { try validateBranchUpstreamEntries(upstreams); const owned = try allocator.alloc(BranchUpstreamEntry, upstreams.len); var count: usize = 0; errdefer { for (owned[0..count]) |*upstream| upstream.deinit(allocator); if (owned.len != 0) allocator.free(owned); } for (upstreams, owned) |upstream, *target| { target.* = try BranchUpstreamEntry.init(allocator, upstream.branch, upstream.remote, upstream.remote_branch); count += 1; } return .{ .allocator = allocator, .upstreams = owned, }; } pub fn deinit(self: *BranchUpstreamConfig) void { for (self.upstreams) |*upstream| upstream.deinit(self.allocator); if (self.upstreams.len != 0) self.allocator.free(self.upstreams); self.* = undefined; } pub fn find(self: *const BranchUpstreamConfig, branch_name: []const u8) ?*const BranchUpstreamEntry { for (self.upstreams) |*upstream| { if (std.mem.eql(u8, upstream.branch, branch_name)) return upstream; } return null; }};Source: lib/sql/src/root.zig:109
zig
pub const HistoryBranchUpstreamConfig = sync.BranchUpstreamConfig;Audit
| Definitions | 4 |
|---|---|
| Public names | 8 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |