summaryrefslogtreecommitdiff
path: root/tests/reset/hard.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2014-02-03 14:08:40 -0800
committerBen Straub <bs@github.com>2014-02-03 14:08:40 -0800
commit0d847a31598a933877d94430b2fe80bade55fe1a (patch)
treef07819e74fd2ddc759e1bc86ff24e6e02a8ddfde /tests/reset/hard.c
parent3b6a5bac20a9cb46cd29d74baf06cf8a8d1248fb (diff)
downloadlibgit2-0d847a31598a933877d94430b2fe80bade55fe1a.tar.gz
Reset helpers: use revparse instead
Diffstat (limited to 'tests/reset/hard.c')
-rw-r--r--tests/reset/hard.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/reset/hard.c b/tests/reset/hard.c
index 0f80d32df..8e9a94ca1 100644
--- a/tests/reset/hard.c
+++ b/tests/reset/hard.c
@@ -69,8 +69,7 @@ void test_reset_hard__resetting_reverts_modified_files(void)
cl_assert_equal_s(before[i], content.ptr);
}
- retrieve_target_from_oid(
- &target, repo, "26a125ee1bfc5df1e1b2e9441bbe63c8a7ae989f");
+ cl_git_pass(git_revparse_single(&target, repo, "26a125e"));
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD));
@@ -95,7 +94,7 @@ void test_reset_hard__cannot_reset_in_a_bare_repository(void)
cl_git_pass(git_repository_open(&bare, cl_fixture("testrepo.git")));
cl_assert(git_repository_is_bare(bare) == true);
- retrieve_target_from_oid(&target, bare, KNOWN_COMMIT_IN_BARE_REPO);
+ cl_git_pass(git_revparse_single(&target, bare, KNOWN_COMMIT_IN_BARE_REPO));
cl_assert_equal_i(GIT_EBAREREPO, git_reset(bare, target, GIT_RESET_HARD));
@@ -152,7 +151,7 @@ void test_reset_hard__resetting_reverts_unmerged(void)
unmerged_index_init(index, entries);
cl_git_pass(git_index_write(index));
- retrieve_target_from_oid(&target, repo, "26a125ee1bfc5df1e1b2e9441bbe63c8a7ae989f");
+ cl_git_pass(git_revparse_single(&target, repo, "26a125e"));
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD));
cl_assert(git_path_exists("status/conflicting_file") == 0);
@@ -183,7 +182,7 @@ void test_reset_hard__cleans_up_merge(void)
cl_git_pass(git_buf_joinpath(&orig_head_path, git_repository_path(repo), "ORIG_HEAD"));
cl_git_mkfile(git_buf_cstr(&orig_head_path), "0017bd4ab1ec30440b17bae1680cff124ab5f1f6");
- retrieve_target_from_oid(&target, repo, "0017bd4ab1ec30440b17bae1680cff124ab5f1f6");
+ cl_git_pass(git_revparse_single(&target, repo, "0017bd4"));
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD));
cl_assert(!git_path_exists(git_buf_cstr(&merge_head_path)));