git_checkout_opts *opts;
git_repository *repo;
git_odb *odb;
- bool do_symlinks;
+ bool no_symlinks;
} tree_walk_data;
/* Create the link */
const char *new = git_buf_cstr(&linktarget),
*old = git_buf_cstr(fnbuf);
- retcode = data->do_symlinks
- ? p_symlink(new, old)
- : git_futils_fake_symlink(new, old);
+ retcode = data->no_symlinks
+ ? git_futils_fake_symlink(new, old)
+ : p_symlink(new, old);
}
git_buf_free(&linktarget);
git_blob_free(blob);
return GIT_ERROR;
}
+ memset(&payload, 0, sizeof(payload));
+
/* Determine if symlinks should be handled */
- if (!git_repository_config(&cfg, repo)) {
+ if (!git_repository_config__weakptr(&cfg, repo)) {
int temp = true;
if (!git_config_get_bool(&temp, cfg, "core.symlinks")) {
- payload.do_symlinks = !!temp;
+ payload.no_symlinks = !temp;
}
- git_config_free(cfg);
}
stats->total = stats->processed = 0;
if (flags & GIT_FILEBUF_FORCE)
p_unlink(file->path_lock);
else {
+ giterr_clear(); /* actual OS error code just confuses */
giterr_set(GITERR_OS,
"Failed to lock file '%s' for writing", file->path_lock);
return -1;
error = -1;
goto cleanup;
}
+
+ memset(&entry, 0, sizeof(entry));
entry.path = sm->path;
git_index__init_entry_from_stat(&st, &entry);