diff options
Diffstat (limited to 'tests/clone/empty.c')
-rw-r--r-- | tests/clone/empty.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/clone/empty.c b/tests/clone/empty.c index 6d19244cc..78aef7dae 100644 --- a/tests/clone/empty.c +++ b/tests/clone/empty.c @@ -38,7 +38,7 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void) char *local_name = "refs/heads/master"; const char *expected_tracked_branch_name = "refs/remotes/origin/master"; const char *expected_remote_name = "origin"; - char buffer[1024]; + git_buf buf = GIT_BUF_INIT; git_reference *ref; cl_set_cleanup(&cleanup_repository, "./empty"); @@ -50,16 +50,14 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void) cl_assert_equal_i(GIT_ENOTFOUND, git_reference_lookup(&ref, g_repo_cloned, local_name)); /* ...one can still retrieve the name of the remote tracking reference */ - cl_assert_equal_i((int)strlen(expected_tracked_branch_name) + 1, - git_branch_upstream_name(buffer, 1024, g_repo_cloned, local_name)); + cl_git_pass(git_branch_upstream_name(&buf, g_repo_cloned, local_name)); - cl_assert_equal_s(expected_tracked_branch_name, buffer); + cl_assert_equal_s(expected_tracked_branch_name, buf.ptr); /* ...and the name of the remote... */ - cl_assert_equal_i((int)strlen(expected_remote_name) + 1, - git_branch_remote_name(buffer, 1024, g_repo_cloned, expected_tracked_branch_name)); + cl_git_pass(git_branch_remote_name(&buf, g_repo_cloned, expected_tracked_branch_name)); - cl_assert_equal_s(expected_remote_name, buffer); + cl_assert_equal_s(expected_remote_name, buf.ptr); /* ...even when the remote HEAD is unborn as well */ cl_assert_equal_i(GIT_ENOTFOUND, git_reference_lookup(&ref, g_repo_cloned, |