diff options
Diffstat (limited to 'tests/refs/branches/remote.c')
-rw-r--r-- | tests/refs/branches/remote.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/refs/branches/remote.c b/tests/refs/branches/remote.c index 27a3b0c44..e2bd3485a 100644 --- a/tests/refs/branches/remote.c +++ b/tests/refs/branches/remote.c @@ -32,10 +32,9 @@ void test_refs_branches_remote__can_get_remote_for_branch(void) void test_refs_branches_remote__no_matching_remote_returns_error(void) { const char *unknown = "refs/remotes/nonexistent/master"; - git_buf buf; + git_buf buf = GIT_BUF_INIT; git_error_clear(); - memset(&buf, 0, sizeof(git_buf)); cl_git_fail_with(git_branch_remote_name(&buf, g_repo, unknown), GIT_ENOTFOUND); cl_assert(git_error_last() != NULL); } @@ -43,10 +42,9 @@ void test_refs_branches_remote__no_matching_remote_returns_error(void) void test_refs_branches_remote__local_remote_returns_error(void) { const char *local = "refs/heads/master"; - git_buf buf; + git_buf buf = GIT_BUF_INIT; git_error_clear(); - memset(&buf, 0, sizeof(git_buf)); cl_git_fail_with(git_branch_remote_name(&buf, g_repo, local), GIT_ERROR); cl_assert(git_error_last() != NULL); } @@ -54,7 +52,7 @@ void test_refs_branches_remote__local_remote_returns_error(void) void test_refs_branches_remote__ambiguous_remote_returns_error(void) { git_remote *remote; - git_buf buf; + git_buf buf = GIT_BUF_INIT; /* Create the remote */ cl_git_pass(git_remote_create_with_fetchspec(&remote, g_repo, "addtest", "http://github.com/libgit2/libgit2", "refs/heads/*:refs/remotes/test/*")); @@ -62,7 +60,6 @@ void test_refs_branches_remote__ambiguous_remote_returns_error(void) git_remote_free(remote); git_error_clear(); - memset(&buf, 0, sizeof(git_buf)); cl_git_fail_with(git_branch_remote_name(&buf, g_repo, remote_tracking_branch_name), GIT_EAMBIGUOUS); cl_assert(git_error_last() != NULL); } |