| author | |
| committer | |
| log | 292acfc7a2d4f279b380cd1544d8b3beab0fe99b |
| tree | 3756c695ca7167ff20ee584ab72afbf43897b8e1 |
| parent | b2a1b0177e348968417799b578792647750cd7b4 |
3 files changed, 4 insertions(+), 4 deletions(-)
src/cmd/fetch.zig+1-1| ... | ... | @@ -119,7 +119,7 @@ fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { |
| 119 | 119 | for (list.items) |m| { |
| 120 | 120 | if (m.dep) |md| { |
| 121 | 121 | const mpath = try std.fs.path.join(gpa, &.{ dir, m.clean_path }); |
| 122 | const version = if (md.version.len > 0) md.version else (try md.type.exact_version(mpath))[0..14]; | |
| 122 | const version = if (md.version.len > 0) md.version else (try md.type.exact_version(mpath)); | |
| 123 | 123 | try wl.print("{s} {s} {s} {s}\n", .{ m.clean_path, @tagName(md.type), md.path, version }); |
| 124 | 124 | } |
| 125 | 125 | } |
src/util/dep_type.zig+1-1| ... | ... | @@ -78,7 +78,7 @@ pub const DepType = enum { |
| 78 | 78 | return switch (self) { |
| 79 | 79 | .local => "", |
| 80 | 80 | .system_lib => "", |
| 81 | .git => try std.fmt.allocPrint(gpa, "commit-{s}", .{try u.git_rev_HEAD(gpa, mpath)}), | |
| 81 | .git => try std.fmt.allocPrint(gpa, "commit-{s}", .{(try u.git_rev_HEAD(gpa, mpath))[0..7]}), | |
| 82 | 82 | .hg => "", |
| 83 | 83 | .http => "", |
| 84 | 84 | }; |
src/util/funcs.zig+2-2| ... | ... | @@ -255,7 +255,7 @@ pub fn git_rev_HEAD(alloc: *std.mem.Allocator, path: []const u8) ![]const u8 { |
| 255 | 255 | const max = std.math.maxInt(usize); |
| 256 | 256 | const dir = try std.fs.cwd().openDir(path, .{}); |
| 257 | 257 | const dirg = try dir.openDir(".git", .{}); |
| 258 | const h = std.mem.trimRight(u8, try dirg.readFileAlloc(alloc, "HEAD", max), "\n"); | |
| 259 | const r = std.mem.trimRight(u8, try dirg.readFileAlloc(alloc, h[5..], max), "\n"); | |
| 258 | const h = std.mem.trim(u8, try dirg.readFileAlloc(alloc, "HEAD", max), "\n"); | |
| 259 | const r = std.mem.trim(u8, try dirg.readFileAlloc(alloc, h[5..], max), "\n"); | |
| 260 | 260 | return r; |
| 261 | 261 | } |