| ... | @@ -99,7 +99,6 @@ fn get_moddir(basedir: []const u8, d: u.Dep, parent_name: []const u8, options: * | ... | @@ -99,7 +99,6 @@ fn get_moddir(basedir: []const u8, d: u.Dep, parent_name: []const u8, options: * |
| 99 | if (!nocache and u.list_contains(options.already_fetched.items, p)) return p; | 99 | if (!nocache and u.list_contains(options.already_fetched.items, p)) return p; |
| 100 | if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv; | 100 | if (!nocache and u.list_contains(options.already_fetched.items, pv)) return pv; |
| 101 | | 101 | |
| 102 | const tempdir = try std.fs.path.join(gpa, &.{ basedir, "temp" }); | | |
| 103 | if (options.log and d.type != .local) { | 102 | if (options.log and d.type != .local) { |
| 104 | u.print("fetch: {s}: {s}: {s}", .{ parent_name, @tagName(d.type), d.path }); | 103 | u.print("fetch: {s}: {s}: {s}", .{ parent_name, @tagName(d.type), d.path }); |
| 105 | } | 104 | } |
| ... | @@ -138,13 +137,10 @@ fn get_moddir(basedir: []const u8, d: u.Dep, parent_name: []const u8, options: * | ... | @@ -138,13 +137,10 @@ fn get_moddir(basedir: []const u8, d: u.Dep, parent_name: []const u8, options: * |
| 138 | } | 137 | } |
| 139 | return pv; | 138 | return pv; |
| 140 | } | 139 | } |
| 141 | try d.type.pull(d.path, tempdir); | 140 | try d.type.pull(d.path, pv); |
| 142 | if ((try u.run_cmd(tempdir, &.{ "git", "checkout", vers.string })) > 0) { | 141 | if ((try u.run_cmd(pv, &.{ "git", "checkout", vers.string })) > 0) { |
| 143 | u.assert(false, "fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); | 142 | u.assert(false, "fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); |
| 144 | } | 143 | } |
| 145 | const td_fd = try std.fs.cwd().openDir(basedir, .{}); | | |
| 146 | try std.fs.cwd().makePath(pv); | | |
| 147 | try td_fd.rename("temp", try d.clean_path_v()); | | |
| 148 | if (vers.id != .branch) { | 144 | if (vers.id != .branch) { |
| 149 | const pvd = try std.fs.cwd().openDir(pv, .{}); | 145 | const pvd = try std.fs.cwd().openDir(pv, .{}); |
| 150 | try pvd.deleteTree(".git"); | 146 | try pvd.deleteTree(".git"); |