authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-17 13:15:34 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-17 13:15:34 -07:00
log654f63447d30a42b891c5f8e56e15773978cd239
tree5d5e9ce6cc6868d1ecb1d4da27071b2e16bb9920
parent16bef4f149538712b90ead827bce5e358ea7adf9

fetch: only delete the .git folder when version is a commit


1 files changed, 1 insertions(+), 1 deletions(-)

src/common.zig+1-1
...@@ -151,7 +151,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !...@@ -151,7 +151,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !
151 if ((try u.run_cmd(options.alloc, pv, &.{ "git", "checkout", vers.string })) > 0) {151 if ((try u.run_cmd(options.alloc, pv, &.{ "git", "checkout", vers.string })) > 0) {
152 u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string });152 u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string });
153 }153 }
154 if (builtin.os.tag != .windows and vers.id != .branch) {154 if (builtin.os.tag != .windows and vers.id == .commit) {
155 const pvd = try std.fs.cwd().openDir(pv, .{});155 const pvd = try std.fs.cwd().openDir(pv, .{});
156 try pvd.deleteTree(".git");156 try pvd.deleteTree(".git");
157 }157 }