From: Jason Newton via GitGitGadget Date: Wed, 21 Oct 2026 07:17:41 GMT Subject: [PATCH v3 4/4] worktree: keep the reflink probe referenced on Windows Message-ID: <876fb541a8e1d43731bb72ddbbf1c49da8760775.1792567061.git.gitgitgadget@gmail.com> In-Reply-To: From: Jason Newton The mingw build compiles with -Werror=unused-function. Putting the reflink_supported() call in the non-Windows branch left that function unused, so "win build" failed at builtin/worktree.c:445. Leave the call in the common path. The Windows return still happens first. Signed-off-by: Jason Newton --- builtin/worktree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 93fcaa5ecd..07adf6bb7f 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -568,13 +568,15 @@ static int reflink_worktree(const char *path, const char *wt_git_dir, * reflink_file() refuses on Windows. Build 26200 is the version * named in git-lfs issue 6312; no later build is known to be fixed. * Auto mode stays quiet, matching the non-Windows fallback. + * Return before the probe, but leave the call compiled: an #else + * around it makes reflink_supported() unused under -Werror. */ if (!opts->quiet && opts->reflink != REFLINK_AUTO) warning(_("reflink is disabled on Windows; block cloning " "can zero-fill files on Windows build 26200; " "falling back to a regular checkout")); return 1; -#else +#endif if (!reflink_supported(path)) { /* In auto mode the fallback is expected, so stay quiet. */ if (!opts->quiet && opts->reflink != REFLINK_AUTO) @@ -582,7 +584,6 @@ static int reflink_worktree(const char *path, const char *wt_git_dir, "falling back to a regular checkout"), path); return 1; } -#endif if (stat(path, &dst_st)) return error_errno(_("could not stat '%s'"), path); -- gitgitgadget