summaryrefslogtreecommitdiff
path: root/tests/test_helpers.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-03-19 08:19:34 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-23 00:25:04 +0200
commitf428ae615b4386e78cb337386b3d8e190e921766 (patch)
treef3a7cad4c1e3c76298dd36af2aec3478ad1cf434 /tests/test_helpers.c
parentba1bdf86e74777f1a597ac2737dddd7965f41711 (diff)
downloadlibgit2-f428ae615b4386e78cb337386b3d8e190e921766.tar.gz
Slightly enforce copy_recurs() behavior
The folder creation is now decorrelated from the recursive parsing of the source tree structure.
Diffstat (limited to 'tests/test_helpers.c')
-rw-r--r--tests/test_helpers.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/test_helpers.c b/tests/test_helpers.c
index 588461135..1d345356a 100644
--- a/tests/test_helpers.c
+++ b/tests/test_helpers.c
@@ -141,7 +141,7 @@ int copy_file(const char *src, const char *dst)
if (gitfo_read_file(&source_buf, src) < GIT_SUCCESS)
return GIT_ENOTFOUND;
- dst_fd = gitfo_creat(dst, 0644);
+ dst_fd = gitfo_creat_force(dst, 0644);
if (dst_fd < 0)
goto cleanup;
@@ -211,18 +211,13 @@ typedef struct {
static int copy_filesystem_element_recurs(void *_data, char *source)
{
- const int mode = 0755; /* or 0777 ? */
copydir_data *data = (copydir_data *)_data;
data->dst[data->dst_len] = 0;
git__joinpath(data->dst, data->dst, source + data->src_len);
- if (gitfo_isdir(source) == GIT_SUCCESS) {
- if (gitfo_mkdir(data->dst, mode) < GIT_SUCCESS)
- return GIT_EOSERR;
-
+ if (gitfo_isdir(source) == GIT_SUCCESS)
return gitfo_dirent(source, GIT_PATH_MAX, copy_filesystem_element_recurs, _data);
- }
return copy_file(source, data->dst);
}