From 5a9fc6c83c2fd12ce312d1042ec2c1e6abad4033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 4 May 2015 16:22:56 +0200 Subject: submodule: make set_ignore() affect the configuration Instead of affecting a particular instance, make it change the configuration. --- tests/diff/submodules.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/diff/submodules.c') diff --git a/tests/diff/submodules.c b/tests/diff/submodules.c index e2169583b..08682cd4b 100644 --- a/tests/diff/submodules.c +++ b/tests/diff/submodules.c @@ -273,13 +273,13 @@ void test_diff_submodules__invalid_cache(void) /* create untracked file in submodule working directory */ cl_git_mkfile("submod2/sm_changed_head/new_around_here", "hello"); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_NONE); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_NONE); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_UNTRACKED); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_UNTRACKED); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -301,7 +301,7 @@ void test_diff_submodules__invalid_cache(void) check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -312,13 +312,13 @@ void test_diff_submodules__invalid_cache(void) cl_git_pass(git_repository_index(&smindex, smrepo)); cl_git_pass(git_index_add_bypath(smindex, "file_to_modify")); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_UNTRACKED); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_UNTRACKED); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -327,19 +327,19 @@ void test_diff_submodules__invalid_cache(void) /* commit changed index of submodule */ cl_repo_commit_from_index(NULL, smrepo, NULL, 1372350000, "Move it"); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_moved); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_ALL); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_ALL); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_NONE); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_NONE); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_moved_dirty); -- cgit v1.2.1