From 654f63447d30a42b891c5f8e56e15773978cd239 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 17 Sep 2022 13:15:34 -0700 Subject: [PATCH] fetch: only delete the .git folder when version is a commit --- src/common.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.zig b/src/common.zig index 3a6852e79e5f21b60662aedc1e0a7cf93fc72fe5..e17e3abd48453fa65dff05e460babac957333e75 100644 --- a/src/common.zig +++ b/src/common.zig @@ -151,7 +151,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! if ((try u.run_cmd(options.alloc, pv, &.{ "git", "checkout", vers.string })) > 0) { u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string }); } - if (builtin.os.tag != .windows and vers.id != .branch) { + if (builtin.os.tag != .windows and vers.id == .commit) { const pvd = try std.fs.cwd().openDir(pv, .{}); try pvd.deleteTree(".git"); } -- 2.54.0