Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-04-09 05:03:51 +0400
committerBen Straub <bs@github.com>2013-04-09 05:07:04 +0400
commit1aa21fe3b87a1e601023f49c41fab3ce76c189ac (patch)
treeb25c258e7d360cb9dd7d278094ff12b490a0e61e /tests-clar/stash
parent8480eef7ee0c8e52a8bf3ea12e5626009a966164 (diff)
Deprecate git_revparse_single and _rangelike
Diffstat (limited to 'tests-clar/stash')
-rw-r--r--tests-clar/stash/drop.c19
-rw-r--r--tests-clar/stash/save.c16
2 files changed, 17 insertions, 18 deletions
diff --git a/tests-clar/stash/drop.c b/tests-clar/stash/drop.c
index d171390da..da9e676a9 100644
--- a/tests-clar/stash/drop.c
+++ b/tests-clar/stash/drop.c
@@ -140,35 +140,30 @@ void test_stash_drop__dropping_the_last_entry_removes_the_stash(void)
void retrieve_top_stash_id(git_oid *out)
{
- git_object *top_stash;
+ git_oid top_stash_id;
- cl_git_pass(git_revparse_single(&top_stash, repo, "stash@{0}"));
+ cl_git_pass(git_revparse(&top_stash_id, NULL, NULL, 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, git_object_id(top_stash)) == 0);
-
- git_object_free(top_stash);
+ cl_assert_equal_i(true, git_oid_cmp(out, &top_stash_id) == 0);
}
void test_stash_drop__dropping_the_top_stash_updates_the_stash_reference(void)
{
- git_object *next_top_stash;
+ git_oid next_top_stash_id;
git_oid oid;
push_three_states();
retrieve_top_stash_id(&oid);
- 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_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_stash_drop(repo, 0));
retrieve_top_stash_id(&oid);
cl_assert_equal_i(
- true, git_oid_cmp(&oid, git_object_id(next_top_stash)) == 0);
-
- git_object_free(next_top_stash);
+ true, git_oid_cmp(&oid, &next_top_stash_id) == 0);
}
diff --git a/tests-clar/stash/save.c b/tests-clar/stash/save.c
index 588dfc3ea..4185e549c 100644
--- a/tests-clar/stash/save.c
+++ b/tests-clar/stash/save.c
@@ -37,10 +37,11 @@ void test_stash_save__cleanup(void)
static void assert_object_oid(const char* revision, const char* expected_oid, git_otype type)
{
- git_object *object;
+ git_oid oid;
int result;
+ git_object *obj;
- result = git_revparse_single(&object, repo, revision);
+ result = git_revparse(&oid, NULL, NULL, repo, revision);
if (!expected_oid) {
cl_assert_equal_i(GIT_ENOTFOUND, result);
@@ -48,10 +49,11 @@ static void assert_object_oid(const char* revision, const char* expected_oid, gi
} else
cl_assert_equal_i(0, result);
- cl_assert_equal_i(type, git_object_type(object));
- cl_git_pass(git_oid_streq(git_object_id(object), expected_oid));
+ cl_git_pass(git_oid_streq(&oid, expected_oid));
- git_object_free(object);
+ cl_git_pass(git_object_lookup(&obj, repo, &oid, GIT_OBJ_ANY));
+ cl_assert_equal_i(type, git_object_type(obj));
+ git_object_free(obj);
}
static void assert_blob_oid(const char* revision, const char* expected_oid)
@@ -145,9 +147,11 @@ void test_stash_save__can_keep_index(void)
static void assert_commit_message_contains(const char *revision, const char *fragment)
{
+ git_oid oid;
git_commit *commit;
- cl_git_pass(git_revparse_single(((git_object **)&commit), repo, revision));
+ cl_git_pass(git_revparse(&oid, NULL, NULL, repo, revision));
+ cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_assert(strstr(git_commit_message(commit), fragment) != NULL);