summaryrefslogtreecommitdiff
path: root/tests-clar/diff/diffiter.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-14 23:29:48 -0800
committerRussell Belfer <rb@github.com>2012-11-14 23:29:48 -0800
commitbbe6dbec81d2050fb52b600bc27e2dacdc780e77 (patch)
tree61f442146ed5b98352016f4ecec3ac4736e10c8c /tests-clar/diff/diffiter.c
parentbad68c0a998116685ad75cab84210004dd2c5be1 (diff)
downloadlibgit2-bbe6dbec81d2050fb52b600bc27e2dacdc780e77.tar.gz
Add explicit git_index ptr to diff and checkout
A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
Diffstat (limited to 'tests-clar/diff/diffiter.c')
-rw-r--r--tests-clar/diff/diffiter.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests-clar/diff/diffiter.c b/tests-clar/diff/diffiter.c
index f021d46f4..133392c21 100644
--- a/tests-clar/diff/diffiter.c
+++ b/tests-clar/diff/diffiter.c
@@ -16,7 +16,7 @@ void test_diff_diffiter__create(void)
git_diff_list *diff;
size_t d, num_d;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, NULL));
num_d = git_diff_num_deltas(diff);
for (d = 0; d < num_d; ++d) {
@@ -34,7 +34,7 @@ void test_diff_diffiter__iterate_files(void)
size_t d, num_d;
int count = 0;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, NULL));
num_d = git_diff_num_deltas(diff);
cl_assert_equal_i(6, (int)num_d);
@@ -57,7 +57,7 @@ void test_diff_diffiter__iterate_files_2(void)
size_t d, num_d;
int count = 0;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, NULL));
num_d = git_diff_num_deltas(diff);
cl_assert_equal_i(8, (int)num_d);
@@ -85,7 +85,7 @@ void test_diff_diffiter__iterate_files_and_hunks(void)
opts.interhunk_lines = 1;
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, &opts));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, &opts));
num_d = git_diff_num_deltas(diff);
@@ -138,7 +138,7 @@ void test_diff_diffiter__max_size_threshold(void)
opts.interhunk_lines = 1;
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, &opts));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, &opts));
num_d = git_diff_num_deltas(diff);
for (d = 0; d < num_d; ++d) {
@@ -173,7 +173,7 @@ void test_diff_diffiter__max_size_threshold(void)
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
opts.max_size = 50; /* treat anything over 50 bytes as binary! */
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, &opts));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, &opts));
num_d = git_diff_num_deltas(diff);
for (d = 0; d < num_d; ++d) {
@@ -216,7 +216,7 @@ void test_diff_diffiter__iterate_all(void)
opts.interhunk_lines = 1;
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, &opts));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, &opts));
num_d = git_diff_num_deltas(diff);
for (d = 0; d < num_d; ++d) {
@@ -292,7 +292,7 @@ void test_diff_diffiter__iterate_randomly_while_saving_state(void)
opts.interhunk_lines = 1;
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, &opts));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, &opts));
num_d = git_diff_num_deltas(diff);
@@ -419,7 +419,7 @@ void test_diff_diffiter__iterate_and_generate_patch_text(void)
git_diff_list *diff;
size_t d, num_d;
- cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL));
+ cl_git_pass(git_diff_workdir_to_index(&diff, repo, NULL, NULL));
num_d = git_diff_num_deltas(diff);
cl_assert_equal_i(8, (int)num_d);