diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-15 12:18:05 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-15 12:18:05 +0200 |
commit | 54738368ec469dd9706c5c8f97d24affde9edae8 (patch) | |
tree | 6d033f46d40b3020abdde3297c628a765d8f66c7 | |
parent | 8a4d77f990b4453e42e3c2cc61df5175b39586d3 (diff) | |
download | libgit2-54738368ec469dd9706c5c8f97d24affde9edae8.tar.gz |
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.
-rw-r--r-- | src/fileops.c | 3 |
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 { |