| ... | ... | @@ -28,7 +28,7 @@ pub fn version(alloc: std.mem.Allocator) !string { |
| 28 | 28 | /// dir must already be pointing at the .git folder |
| 29 | 29 | // TODO this doesnt handle when there are 0 commits |
| 30 | 30 | pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !?CommitId { |
| 31 | | const t = tracer.trace(@src()); |
| 31 | const t = tracer.trace(@src(), "", .{}); |
| 32 | 32 | defer t.end(); |
| 33 | 33 | |
| 34 | 34 | const h = std.mem.trimRight(u8, try dir.readFileAlloc(alloc, "HEAD", 1024), "\n"); |
| ... | ... | @@ -74,7 +74,7 @@ fn ensureObjId(comptime T: type, input: string) T { |
| 74 | 74 | // https://git-scm.com/book/en/v2/Git-Internals-Git-Objects |
| 75 | 75 | // https://git-scm.com/book/en/v2/Git-Internals-Packfiles |
| 76 | 76 | pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string { |
| 77 | | const t = tracer.trace(@src()); |
| 77 | const t = tracer.trace(@src(), "", .{}); |
| 78 | 78 | defer t.end(); |
| 79 | 79 | |
| 80 | 80 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -92,7 +92,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string { |
| 92 | 92 | // https://git-scm.com/book/en/v2/Git-Internals-Git-Objects |
| 93 | 93 | // https://git-scm.com/book/en/v2/Git-Internals-Packfiles |
| 94 | 94 | pub fn getObjectSize(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !u64 { |
| 95 | | const t = tracer.trace(@src()); |
| 95 | const t = tracer.trace(@src(), "", .{}); |
| 96 | 96 | defer t.end(); |
| 97 | 97 | |
| 98 | 98 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -108,7 +108,7 @@ pub fn getObjectSize(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !u64 { |
| 108 | 108 | // https://git-scm.com/book/en/v2/Git-Internals-Git-Objects |
| 109 | 109 | // https://git-scm.com/book/en/v2/Git-Internals-Packfiles |
| 110 | 110 | pub fn isType(alloc: std.mem.Allocator, dir: std.fs.Dir, maybeobj: Id, typ: Tree.Object.Id.Tag) !?bool { |
| 111 | | const t = tracer.trace(@src()); |
| 111 | const t = tracer.trace(@src(), "", .{}); |
| 112 | 112 | defer t.end(); |
| 113 | 113 | |
| 114 | 114 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -125,7 +125,7 @@ pub fn isType(alloc: std.mem.Allocator, dir: std.fs.Dir, maybeobj: Id, typ: Tree |
| 125 | 125 | // https://git-scm.com/book/en/v2/Git-Internals-Git-Objects |
| 126 | 126 | // https://git-scm.com/book/en/v2/Git-Internals-Packfiles |
| 127 | 127 | pub fn getType(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !Tree.Object.Id.Tag { |
| 128 | | const t = tracer.trace(@src()); |
| 128 | const t = tracer.trace(@src(), "", .{}); |
| 129 | 129 | defer t.end(); |
| 130 | 130 | |
| 131 | 131 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -144,7 +144,7 @@ pub fn getType(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !Tree.Object. |
| 144 | 144 | // https://git-scm.com/book/en/v2/Git-Internals-Git-Objects |
| 145 | 145 | // https://git-scm.com/book/en/v2/Git-Internals-Packfiles |
| 146 | 146 | pub fn revList(alloc: std.mem.Allocator, dir: std.fs.Dir, comptime count: u31, from: CommitId, sub_path: string) !string { |
| 147 | | const t = tracer.trace(@src()); |
| 147 | const t = tracer.trace(@src(), "", .{}); |
| 148 | 148 | defer t.end(); |
| 149 | 149 | |
| 150 | 150 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -164,7 +164,7 @@ pub fn revList(alloc: std.mem.Allocator, dir: std.fs.Dir, comptime count: u31, f |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | pub fn parseCommit(alloc: std.mem.Allocator, commitfile: string) !Commit { |
| 167 | | const t = tracer.trace(@src()); |
| 167 | const t = tracer.trace(@src(), "", .{}); |
| 168 | 168 | defer t.end(); |
| 169 | 169 | |
| 170 | 170 | var iter = std.mem.split(u8, commitfile, "\n"); |
| ... | ... | @@ -188,7 +188,7 @@ pub fn parseCommit(alloc: std.mem.Allocator, commitfile: string) !Commit { |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | fn parseCommitUserAndAt(input: string) !Commit.UserAndAt { |
| 191 | | const t = tracer.trace(@src()); |
| 191 | const t = tracer.trace(@src(), "", .{}); |
| 192 | 192 | defer t.end(); |
| 193 | 193 | |
| 194 | 194 | // Mitchell Hashimoto <mitchell.hashimoto@gmail.com> 1680797363 -0700 |
| ... | ... | @@ -243,7 +243,7 @@ pub const Commit = struct { |
| 243 | 243 | }; |
| 244 | 244 | |
| 245 | 245 | pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree { |
| 246 | | const t = tracer.trace(@src()); |
| 246 | const t = tracer.trace(@src(), "", .{}); |
| 247 | 247 | defer t.end(); |
| 248 | 248 | |
| 249 | 249 | var iter = std.mem.split(u8, treefile, "\n"); |
| ... | ... | @@ -277,7 +277,7 @@ pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree { |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | fn parseTreeMode(input: string) !Tree.Object.Mode { |
| 280 | | const t = tracer.trace(@src()); |
| 280 | const t = tracer.trace(@src(), "", .{}); |
| 281 | 281 | defer t.end(); |
| 282 | 282 | |
| 283 | 283 | std.debug.assert(input.len == 6); |
| ... | ... | @@ -385,7 +385,7 @@ pub const Tree = struct { |
| 385 | 385 | // TODO make this inspect .git manually |
| 386 | 386 | // TODO make this return a Reader when we implement it ourselves |
| 387 | 387 | pub fn getTreeDiff(alloc: std.mem.Allocator, dir: std.fs.Dir, commitid: CommitId, parentid: ?CommitId) !string { |
| 388 | | const t = tracer.trace(@src()); |
| 388 | const t = tracer.trace(@src(), "", .{}); |
| 389 | 389 | defer t.end(); |
| 390 | 390 | |
| 391 | 391 | if (parentid == null) { |
| ... | ... | @@ -411,7 +411,7 @@ pub fn getTreeDiff(alloc: std.mem.Allocator, dir: std.fs.Dir, commitid: CommitId |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | pub fn parseTreeDiffMeta(input: string) !TreeDiffMeta { |
| 414 | | const t = tracer.trace(@src()); |
| 414 | const t = tracer.trace(@src(), "", .{}); |
| 415 | 415 | defer t.end(); |
| 416 | 416 | |
| 417 | 417 | var result = std.mem.zeroes(TreeDiffMeta); |
| ... | ... | @@ -485,7 +485,7 @@ pub const TreeDiffMeta = struct { |
| 485 | 485 | }; |
| 486 | 486 | |
| 487 | 487 | pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff { |
| 488 | | const t = tracer.trace(@src()); |
| 488 | const t = tracer.trace(@src(), "", .{}); |
| 489 | 489 | defer t.end(); |
| 490 | 490 | |
| 491 | 491 | var lineiter = std.mem.split(u8, input, "\n"); |
| ... | ... | @@ -644,7 +644,7 @@ pub const TreeDiff = struct { |
| 644 | 644 | }; |
| 645 | 645 | |
| 646 | 646 | pub fn getBranches(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref { |
| 647 | | const t = tracer.trace(@src()); |
| 647 | const t = tracer.trace(@src(), "", .{}); |
| 648 | 648 | defer t.end(); |
| 649 | 649 | |
| 650 | 650 | const result = try std.ChildProcess.exec(.{ |
| ... | ... | @@ -670,7 +670,7 @@ pub fn getBranches(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref { |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref { |
| 673 | | const t = tracer.trace(@src()); |
| 673 | const t = tracer.trace(@src(), "", .{}); |
| 674 | 674 | defer t.end(); |
| 675 | 675 | |
| 676 | 676 | // 97bc4b5f87656a34139e1a8122866c8c5b432598 refs/tags/1.2.5 |