mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 20:29:27 +00:00
fileops: set an error message if we fail to link a file
Now that `git_path_direach` lets us specify an error message to report, set an appropriate error message while linking.
This commit is contained in:
parent
8a4d77f990
commit
54738368ec
@ -861,7 +861,8 @@ static int _cp_r_callback(void *ref, git_buf *from)
|
||||
|
||||
/* make symlink or regular file */
|
||||
if (info->flags & GIT_CPDIR_LINK_FILES) {
|
||||
error = p_link(from->ptr, info->to.ptr);
|
||||
if ((error = p_link(from->ptr, info->to.ptr)) < 0)
|
||||
giterr_set(GITERR_OS, "failed to link '%s'", from->ptr);
|
||||
} else if (S_ISLNK(from_st.st_mode)) {
|
||||
error = cp_link(from->ptr, info->to.ptr, (size_t)from_st.st_size);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user