authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-07-11 22:12:36 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-07-11 22:12:36 -07:00
log5bcf64a7040873df380d316117420e1c432fab90
treeaec1ef9620ebbae169fd07292db8382e74a32147
parent90d3639411a06f2a665355a00fa314fe15488aac
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

addPackedRefs: ensure the expansion is the kind we're looking for

fix for gcc/tags/

1 files changed, 3 insertions(+), 0 deletions(-)

git.zig+3
...@@ -1265,10 +1265,13 @@ pub const Repository = struct {...@@ -1265,10 +1265,13 @@ pub const Repository = struct {
1265 const content = try file.mmap();1265 const content = try file.mmap();
1266 defer nfs.munmap(content);1266 defer nfs.munmap(content);
1267 var iter = std.mem.splitScalar(u8, content, '\n');1267 var iter = std.mem.splitScalar(u8, content, '\n');
1268 var prev_line: []const u8 = "";
1268 while (iter.next()) |line| {1269 while (iter.next()) |line| {
1270 defer prev_line = line;
1269 if (line.len == 0) break;1271 if (line.len == 0) break;
1270 if (line[0] == '#') continue;1272 if (line[0] == '#') continue;
1271 if (line[0] == '^') {1273 if (line[0] == '^') {
1274 if (!std.mem.startsWith(u8, prev_line[41..], "refs/" ++ kind ++ "/")) continue;
1272 map.values()[map.count() - 1][1] = ensureObjId(CommitId, try arena.dupe(u8, line[1..])).id;1275 map.values()[map.count() - 1][1] = ensureObjId(CommitId, try arena.dupe(u8, line[1..])).id;
1273 continue;1276 continue;
1274 }1277 }