summaryrefslogtreecommitdiff
path: root/tests/test_helpers.c
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-02-17 00:13:34 +0100
committerVicent Martí <tanoku@gmail.com>2012-03-06 00:43:10 +0100
commit1a48112342932e9fcd45a1ff5935f1c9c53b83d1 (patch)
treefbb18cfe64e65025c6e1790972d1a106eea4cc54 /tests/test_helpers.c
parent45d387ac78bcf3167d69b736d0b322717bc492d4 (diff)
downloadlibgit2-1a48112342932e9fcd45a1ff5935f1c9c53b83d1.tar.gz
error-handling: References
Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
Diffstat (limited to 'tests/test_helpers.c')
-rw-r--r--tests/test_helpers.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_helpers.c b/tests/test_helpers.c
index 837358453..9ed0d79d8 100644
--- a/tests/test_helpers.c
+++ b/tests/test_helpers.c
@@ -239,7 +239,7 @@ static int copy_filesystem_element_recurs(void *_data, git_buf *source)
git_buf_truncate(&data->dst, data->dst_baselen);
git_buf_puts(&data->dst, source->ptr + data->src_baselen);
- if (git_path_isdir(source->ptr) == GIT_SUCCESS)
+ if (git_path_isdir(source->ptr) == true)
return git_path_direach(source, copy_filesystem_element_recurs, _data);
else
return copy_file(source->ptr, data->dst.ptr);
@@ -253,8 +253,8 @@ int copydir_recurs(
copydir_data data = { GIT_BUF_INIT, 0, GIT_BUF_INIT, 0 };
/* Source has to exist, Destination hast to _not_ exist */
- if (git_path_isdir(source_directory_path) != GIT_SUCCESS ||
- git_path_isdir(destination_directory_path) == GIT_SUCCESS)
+ if (git_path_isdir(source_directory_path) == false ||
+ git_path_isdir(destination_directory_path) == true)
return GIT_EINVALIDPATH;
git_buf_joinpath(&data.src, source_directory_path, "");
@@ -299,7 +299,7 @@ static int remove_placeholders_recurs(void *_data, git_buf *path)
remove_data *data = (remove_data *)_data;
size_t pathlen;
- if (!git_path_isdir(path->ptr))
+ if (git_path_isdir(path->ptr) == true)
return git_path_direach(path, remove_placeholders_recurs, data);
pathlen = path->size;
@@ -322,7 +322,7 @@ int remove_placeholders(const char *directory_path, const char *filename)
remove_data data;
git_buf buffer = GIT_BUF_INIT;
- if (git_path_isdir(directory_path))
+ if (git_path_isdir(directory_path) == false)
return GIT_EINVALIDPATH;
if ((error = git_buf_sets(&buffer, directory_path)) < GIT_SUCCESS)