╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ find.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
308 try key.ensureTotalCapacity(allocator, base.len + 1 + path.len); 309 for (base) |char| key.appendAssumeCapacity(std.ascii.toLower(char)); 310 key.appendAssumeCapacity(0); 311 key.appendSliceAssumeCapacity(path); 312 } 313 314 // the blob oid a tree entry is indexed under, or null for a submodule: its oid 315 // is a commit in another repo, not a file here. 316 fn indexedOid(comptime hash_kind: hash.HashKind, tree_entry: *const tr.TreeEntry(hash_kind)) ?[]const u8 { 317 if (tree_entry.mode.content.object_type == .gitlink) return null; 318 return &tree_entry.oid; 319 } 320 321 fn parseOid(comptime hash_kind: hash.HashKind, value: []const u8) ![hash.byteLen(hash_kind)]u8 { 322 const len = comptime hash.byteLen(hash_kind); 323 if (value.len != len) return error.InvalidFileIndex; 324 return value[0..len].*; 325 } 326