MCPcopy Create free account
hub / github.com/git/git / copy_sparse_checkout

Function copy_sparse_checkout

builtin/worktree.c:345–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static void copy_sparse_checkout(const char *worktree_git_dir)
346{
347 char *from_file = repo_git_path(the_repository, "info/sparse-checkout");
348 char *to_file = xstrfmt("%s/info/sparse-checkout", worktree_git_dir);
349
350 if (file_exists(from_file)) {
351 if (safe_create_leading_directories(the_repository, to_file) ||
352 copy_file(to_file, from_file, 0666))
353 error(_("failed to copy '%s' to '%s'; sparse-checkout may not work correctly"),
354 from_file, to_file);
355 }
356
357 free(from_file);
358 free(to_file);
359}
360
361static void copy_filtered_worktree_config(const char *worktree_git_dir)
362{

Callers 1

add_worktreeFunction · 0.85

Calls 6

repo_git_pathFunction · 0.85
xstrfmtFunction · 0.85
file_existsFunction · 0.85
copy_fileFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected