git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 4/4] worktree: keep the reflink probe referenced on Windows

From
JGJason Newton via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 21, 2026, 07:17 UTC
Message-ID
<876fb541a8e1d43731bb72ddbbf1c49da8760775.1792567061.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.2317.v3.git.git.1792567061.gitgitgadget@gmail.com>
From: Jason Newton <nevion@gmail.com>

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 <nevion@gmail.com>
---
 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
Previous: Jason Newton via GitGitGadget
Message 23 of 23 in “worktree: copy-on-write creation and shared-branch worktrees”
  1. 0/2 worktree: copy-on-write creation and shared-branch worktreesJason Newton via GitGitGadget, Jun 5, 2026
  2. 1/2 worktree: add --reflink for copy-on-write worktree creationJason Newton via GitGitGadget, Jun 5, 2026
  3. 2/2 worktree: allow sharing a checked-out branch across worktreesJason Newton via GitGitGadget, Jun 5, 2026
  4. brian m. carlsonJun 5, 2026
  5. Junio C HamanoJun 8, 2026
  6. 0/2 worktree: copy-on-write creation and ephemeral branchesJason Newton via GitGitGadget, Oct 20, 2026
  7. 1/2 worktree: add --reflink for copy-on-write worktree creationJason Newton via GitGitGadget, Oct 20, 2026
  8. brian m. carlsonOct 20, 2026
  9. Jason NewtonOct 21, 2026
  10. brian m. carlsonOct 22, 2026
  11. 2/2 worktree: reap ephemeral branches created by "worktree add"Jason Newton via GitGitGadget, Oct 20, 2026
  12. Eric SunshineOct 21, 2026
  13. Jason NewtonOct 21, 2026
  14. Eric SunshineOct 21, 2026
  15. Jason NewtonOct 21, 2026
  16. Phillip WoodOct 21, 2026
  17. Jason NewtonOct 21, 2026
  18. Eric SunshineOct 21, 2026
  19. 0/4 worktree: copy-on-write creation and ephemeral branchesJason Newton via GitGitGadget, Oct 21, 2026
  20. 1/4 worktree: add --reflink for copy-on-write worktree creationJason Newton via GitGitGadget, Oct 21, 2026
  21. 2/4 worktree: reap ephemeral branches created by "worktree add"Jason Newton via GitGitGadget, Oct 21, 2026
  22. 3/4 worktree: disable reflink on WindowsJason Newton via GitGitGadget, Oct 21, 2026
  23. 4/4 worktree: keep the reflink probe referenced on WindowsJason Newton via GitGitGadget, Oct 21, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.