Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-15 13:18:05 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-15 13:18:05 +0300
commit54738368ec469dd9706c5c8f97d24affde9edae8 (patch)
tree6d033f46d40b3020abdde3297c628a765d8f66c7 /src/fileops.c
parent8a4d77f990b4453e42e3c2cc61df5175b39586d3 (diff)
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.
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 0587c446f..566aed1c1 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -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 {