Skip to content

Commit f26018c

Browse files
committed
Debug
1 parent d9a1585 commit f26018c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build/patch.zig

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub fn main() !void {
3333
switch (state) {
3434
.copy => {
3535
const line = getLine(allocator, file) orelse return;
36+
std.debug.print("copy '{s}' ({d})\n", .{ line, line.len });
3637
_ = try output.write(line);
3738
_ = try output.write("\n");
3839
},
@@ -41,15 +42,18 @@ pub fn main() !void {
4142
switch (chunk.action) {
4243
.remove => {
4344
const line = getLine(allocator, file) orelse return;
45+
std.debug.print("remove '{s}' ({d}) '{s}' ({d})\n", .{ line, line.len, chunk.buf, chunk.buf.len });
4446
if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch");
4547
},
4648
.keep => {
4749
const line = getLine(allocator, file) orelse return;
50+
std.debug.print("keep '{s}' ({d}) '{s}' ({d})\n", .{ line, line.len, chunk.buf, chunk.buf.len });
4851
if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch");
4952
_ = try output.write(line);
5053
_ = try output.write("\n");
5154
},
5255
.add => {
56+
std.debug.print("add '{s}' ({d})\n", .{ chunk.buf, chunk.buf.len });
5357
_ = try output.write(chunk.buf);
5458
_ = try output.write("\n");
5559
},

0 commit comments

Comments
 (0)