summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJiri Pospisil <mekishizufu@gmail.com>2014-04-25 15:49:58 +0200
committerJiri Pospisil <mekishizufu@gmail.com>2014-04-25 15:49:58 +0200
commit7b8d564d5da4745e9227676a8768b3b48ca3dff8 (patch)
tree1b354917ad2f641acb7d3d646c068c7603b4471d /tests
parent424222f4157b050fd6417b8805796f7183a38e03 (diff)
downloadlibgit2-7b8d564d5da4745e9227676a8768b3b48ca3dff8.tar.gz
Reset tests: Use sandboxed index
Diffstat (limited to 'tests')
-rw-r--r--tests/reset/default.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/reset/default.c b/tests/reset/default.c
index ecb3e7f9f..c76f14813 100644
--- a/tests/reset/default.c
+++ b/tests/reset/default.c
@@ -185,23 +185,20 @@ void test_reset_default__resetting_unknown_filepaths_does_not_fail(void)
void test_reset_default__staged_rename_reset_delete(void)
{
- git_index *idx;
git_index_entry entry;
const git_index_entry *existing;
char *paths[] = { "new.txt" };
initialize("testrepo2");
- cl_git_pass(git_repository_index(&idx, _repo));
-
- existing = git_index_get_bypath(idx, "new.txt", 0);
+ existing = git_index_get_bypath(_index, "new.txt", 0);
cl_assert(existing);
memcpy(&entry, existing, sizeof(entry));
- cl_git_pass(git_index_remove_bypath(idx, "new.txt"));
+ cl_git_pass(git_index_remove_bypath(_index, "new.txt"));
entry.path = "renamed.txt";
- cl_git_pass(git_index_add(idx, &entry));
+ cl_git_pass(git_index_add(_index, &entry));
_pathspecs.strings = paths;
_pathspecs.count = 1;