From 54738368ec469dd9706c5c8f97d24affde9edae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 15 May 2015 12:18:05 +0200 Subject: [PATCH] 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. --- src/fileops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {