Commit 54738368 by Carlos Martín Nieto

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.
parent 8a4d77f9
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment