authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-24 00:39:57 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-06-24 00:39:57 -07:00
loge5ed412abe39e3244f7c44c797c2acd6addcfd6a
tree9fcbdc225f933ce6b857e801b2346815fd5a420a
parentef7e2dfec90b7189ea59deb3ba464494f1793bf3

extras.assertLog update


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

git.zig+3-3
...@@ -61,7 +61,7 @@ pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !CommitId {...@@ -61,7 +61,7 @@ pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !CommitId {
61}61}
6262
63fn ensureObjId(comptime T: type, input: string) T {63fn ensureObjId(comptime T: type, input: string) T {
64 extras.assertLog(input.len == 40, input);64 extras.assertLog(input.len == 40, "ensureObjId: {s}", .{input});
65 return .{ .id = input[0..40] };65 return .{ .id = input[0..40] };
66}66}
6767
...@@ -643,7 +643,7 @@ pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {...@@ -643,7 +643,7 @@ pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {
643 var jter = std.mem.split(u8, line, " ");643 var jter = std.mem.split(u8, line, " ");
644 const id = ensureObjId(CommitId, jter.next().?).id;644 const id = ensureObjId(CommitId, jter.next().?).id;
645 const label = extras.trimPrefixEnsure(jter.rest(), "refs/tags/").?;645 const label = extras.trimPrefixEnsure(jter.rest(), "refs/tags/").?;
646 extras.assertLog(!std.mem.endsWith(u8, label, "^{}"), label);646 extras.assertLog(!std.mem.endsWith(u8, label, "^{}"), "{s}", .{label});
647647
648 switch (try getType(alloc, dir, id)) {648 switch (try getType(alloc, dir, id)) {
649 .tree => continue,649 .tree => continue,
...@@ -660,7 +660,7 @@ pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {...@@ -660,7 +660,7 @@ pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {
660 var kter = std.mem.split(u8, derefline, " ");660 var kter = std.mem.split(u8, derefline, " ");
661 const id2 = ensureObjId(CommitId, kter.next().?).id;661 const id2 = ensureObjId(CommitId, kter.next().?).id;
662 const label2 = extras.trimPrefixEnsure(kter.rest(), "refs/tags/").?;662 const label2 = extras.trimPrefixEnsure(kter.rest(), "refs/tags/").?;
663 extras.assertLog(std.mem.endsWith(u8, label2, "^{}"), label2);663 extras.assertLog(std.mem.endsWith(u8, label2, "^{}"), "{s}", .{label2});
664 std.debug.assert(std.mem.eql(u8, label, extras.trimSuffixEnsure(label2, "^{}").?));664 std.debug.assert(std.mem.eql(u8, label, extras.trimSuffixEnsure(label2, "^{}").?));
665 // extras.assertLog(try isType(alloc, dir, id2, .commit), id2); // linux kernel has a single tag that points at a tree665 // extras.assertLog(try isType(alloc, dir, id2, .commit), id2); // linux kernel has a single tag that points at a tree
666 if (!(try isType(alloc, dir, id2, .commit)).?) continue;666 if (!(try isType(alloc, dir, id2, .commit)).?) continue;