summaryrefslogtreecommitdiff
path: root/tests/refs/revparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/refs/revparse.c')
-rw-r--r--tests/refs/revparse.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/refs/revparse.c b/tests/refs/revparse.c
index bc6e0a4c4..9c960702a 100644
--- a/tests/refs/revparse.c
+++ b/tests/refs/revparse.c
@@ -1,7 +1,6 @@
#include "clar_libgit2.h"
#include "git2/revparse.h"
-#include "buffer.h"
#include "refs.h"
#include "path.h"
@@ -292,7 +291,7 @@ void test_refs_revparse__upstream(void)
void test_refs_revparse__ordinal(void)
{
assert_invalid_single_spec("master@{-2}");
-
+
/* TODO: make the test below actually fail
* cl_git_fail(git_revparse_single(&g_obj, g_repo, "master@{1a}"));
*/
@@ -326,19 +325,19 @@ void test_refs_revparse__previous_head(void)
static void create_fake_stash_reference_and_reflog(git_repository *repo)
{
git_reference *master, *new_master;
- git_buf log_path = GIT_BUF_INIT;
+ git_str log_path = GIT_STR_INIT;
- git_buf_joinpath(&log_path, git_repository_path(repo), "logs/refs/fakestash");
+ git_str_joinpath(&log_path, git_repository_path(repo), "logs/refs/fakestash");
- cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&log_path)));
+ cl_assert_equal_i(false, git_path_isfile(git_str_cstr(&log_path)));
cl_git_pass(git_reference_lookup(&master, repo, "refs/heads/master"));
cl_git_pass(git_reference_rename(&new_master, master, "refs/fakestash", 0, NULL));
git_reference_free(master);
- cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path)));
+ cl_assert_equal_i(true, git_path_isfile(git_str_cstr(&log_path)));
- git_buf_dispose(&log_path);
+ git_str_dispose(&log_path);
git_reference_free(new_master);
}
@@ -555,7 +554,7 @@ void test_refs_revparse__a_too_short_objectid_returns_EAMBIGUOUS(void)
/*
* $ echo "aabqhq" | git hash-object -t blob --stdin
* dea509d0b3cb8ee0650f6ca210bc83f4678851ba
- *
+ *
* $ echo "aaazvc" | git hash-object -t blob --stdin
* dea509d097ce692e167dfc6a48a7a280cc5e877e
*/
@@ -569,11 +568,11 @@ void test_refs_revparse__a_not_precise_enough_objectid_returns_EAMBIGUOUS(void)
cl_git_mkfile("testrepo/one.txt", "aabqhq\n");
cl_git_mkfile("testrepo/two.txt", "aaazvc\n");
-
+
cl_git_pass(git_repository_index(&index, repo));
cl_git_pass(git_index_add_bypath(index, "one.txt"));
cl_git_pass(git_index_add_bypath(index, "two.txt"));
-
+
cl_git_fail_with(git_revparse_single(&obj, repo, "dea509d0"), GIT_EAMBIGUOUS);
cl_git_pass(git_revparse_single(&obj, repo, "dea509d09"));
@@ -588,7 +587,7 @@ void test_refs_revparse__issue_994(void)
git_repository *repo;
git_reference *head, *with_at;
git_object *target;
-
+
repo = cl_git_sandbox_init("testrepo.git");
cl_assert_equal_i(GIT_ENOTFOUND,