summaryrefslogtreecommitdiff
path: root/tests-clar/stash/drop.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-04-15 12:00:04 -0700
committerBen Straub <bs@github.com>2013-04-15 12:00:04 -0700
commit299a224be16368dc36bef4dc3f5e711ce35300cd (patch)
tree5371b54270c4b84abd586c49d7eb06b80d3d4e7b /tests-clar/stash/drop.c
parent2ebc3c66c292539786b6ec1538f740c5e444fe16 (diff)
downloadlibgit2-299a224be16368dc36bef4dc3f5e711ce35300cd.tar.gz
Change git_revparse to output git_object pointers
This will probably prevent many lookup/free operations in calling code.
Diffstat (limited to 'tests-clar/stash/drop.c')
-rw-r--r--tests-clar/stash/drop.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests-clar/stash/drop.c b/tests-clar/stash/drop.c
index da9e676a9..12f922630 100644
--- a/tests-clar/stash/drop.c
+++ b/tests-clar/stash/drop.c
@@ -140,30 +140,29 @@ void test_stash_drop__dropping_the_last_entry_removes_the_stash(void)
void retrieve_top_stash_id(git_oid *out)
{
- git_oid top_stash_id;
+ git_object *top_stash;
- cl_git_pass(git_revparse(&top_stash_id, NULL, NULL, repo, "stash@{0}"));
+ cl_git_pass(git_revparse_single(&top_stash, repo, "stash@{0}"));
cl_git_pass(git_reference_name_to_id(out, repo, GIT_REFS_STASH_FILE));
- cl_assert_equal_i(true, git_oid_cmp(out, &top_stash_id) == 0);
+ cl_assert_equal_i(true, git_oid_cmp(out, git_object_id(top_stash)) == 0);
}
void test_stash_drop__dropping_the_top_stash_updates_the_stash_reference(void)
{
- git_oid next_top_stash_id;
+ git_object *next_top_stash;
git_oid oid;
push_three_states();
retrieve_top_stash_id(&oid);
- cl_git_pass(git_revparse(&next_top_stash_id, NULL, NULL, repo, "stash@{1}"));
- cl_assert_equal_i(false, git_oid_cmp(&oid, &next_top_stash_id) == 0);
+ cl_git_pass(git_revparse_single(&next_top_stash, repo, "stash@{1}"));
+ cl_assert_equal_i(false, git_oid_cmp(&oid, git_object_id(next_top_stash)) == 0);
cl_git_pass(git_stash_drop(repo, 0));
retrieve_top_stash_id(&oid);
- cl_assert_equal_i(
- true, git_oid_cmp(&oid, &next_top_stash_id) == 0);
+ cl_git_pass(git_oid_cmp(&oid, git_object_id(next_top_stash)));
}