| ... | @@ -149,7 +149,8 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! | ... | @@ -149,7 +149,8 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! |
| 149 | u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); | 149 | u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); |
| 150 | } | 150 | } |
| 151 | if (builtin.os.tag != .windows and vers.id == .commit) { | 151 | if (builtin.os.tag != .windows and vers.id == .commit) { |
| 152 | const pvd = try std.fs.cwd().openDir(pv, .{}); | 152 | var pvd = try std.fs.cwd().openDir(pv, .{}); |
| | 153 | defer pvd.close(); |
| 153 | try pvd.deleteTree(".git"); | 154 | try pvd.deleteTree(".git"); |
| 154 | } | 155 | } |
| 155 | return pv; | 156 | return pv; |
| ... | @@ -321,7 +322,8 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str | ... | @@ -321,7 +322,8 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str |
| 321 | var list = std.ArrayList([4]string).init(alloc); | 322 | var list = std.ArrayList([4]string).init(alloc); |
| 322 | const max = std.math.maxInt(usize); | 323 | const max = std.math.maxInt(usize); |
| 323 | if (!try extras.doesFileExist(dir, "zigmod.lock")) return &[_][4]string{}; | 324 | if (!try extras.doesFileExist(dir, "zigmod.lock")) return &[_][4]string{}; |
| 324 | const f = try dir.openFile("zigmod.lock", .{}); | 325 | var f = try dir.openFile("zigmod.lock", .{}); |
| | 326 | defer f.close(); |
| 325 | const r = f.reader(); | 327 | const r = f.reader(); |
| 326 | var i: usize = 0; | 328 | var i: usize = 0; |
| 327 | var v: usize = 1; | 329 | var v: usize = 1; |