static int symlink_or_fake(git_repository *repo, const char *a, const char *b) { int symlinks; cl_git_pass(git_repository__cvar(&symlinks, repo, GIT_CVAR_SYMLINKS)); if (symlinks) return p_symlink(a, b); else return git_futils_fake_symlink(a, b); }
static int blob_content_to_link(git_blob *blob, const char *path, bool can_symlink) { git_buf linktarget = GIT_BUF_INIT; int error; if ((error = git_blob__getbuf(&linktarget, blob)) < 0) return error; if (can_symlink) error = p_symlink(git_buf_cstr(&linktarget), path); else error = git_futils_fake_symlink(git_buf_cstr(&linktarget), path); git_buf_free(&linktarget); return error; }