tests: fix existing tests when add an ignore=all submodule

There are tests that rely on "git add <submodule>" to update the in the reference in the parent repository which have been updated to use the --force option. Updated tests: - t1013-read-tree-submodule.sh ( fixed in: t/lib-submodule-update.sh ) - t2013-checkout-submodule.sh ( fixed in: t/lib-submodule-update.sh ) - t7406-submodule-update.sh - t7508-status.sh Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Claus Schneider(Eficode) committed Feb 6, 2026 at 13:22 UTC 902013225cb7120c59b6ef8771db5c266041f6d5
2 files changed +4 -4
t/lib-submodule-update.sh
+3 -3
@@ -95,14 +95,14 @@ create_lib_submodule_repo () {
95 git commit -m "modified file2 and added file3" &&
96 git push origin modifications
97 ) &&
98 - git add sub1 &&
98 + git add --force sub1 &&
99 git commit -m "Modify sub1" &&
100
101 git checkout -b add_nested_sub modify_sub1 &&
102 git -C sub1 checkout -b "add_nested_sub" &&
103 git -C sub1 submodule add --branch no_submodule ../submodule_update_sub2 sub2 &&
104 git -C sub1 commit -a -m "add a nested submodule" &&
105 - git add sub1 &&
105 + git add --force sub1 &&
106 git commit -a -m "update submodule, that updates a nested submodule" &&
107 git checkout -b modify_sub1_recursively &&
108 git -C sub1 checkout -b modify_sub1_recursively &&
@@ -112,7 +112,7 @@ create_lib_submodule_repo () {
112 git -C sub1/sub2 commit -m "make a change in nested sub" &&
113 git -C sub1 add sub2 &&
114 git -C sub1 commit -m "update nested sub" &&
115 - git add sub1 &&
115 + git add --force sub1 &&
116 git commit -m "update sub1, that updates nested sub" &&
117 git -C sub1 push origin modify_sub1_recursively &&
118 git -C sub1/sub2 push origin modify_sub1_recursively &&
t/t7508-status.sh
+1 -1
@@ -1576,7 +1576,7 @@ test_expect_success 'git commit will commit a staged but ignored submodule' '
1576
1577 test_expect_success 'git commit --dry-run will show a staged but ignored submodule' '
1578 git reset HEAD^ &&
1579 - git add sm &&
1579 + git add --force sm &&
1580 cat >expect << EOF &&
1581 On branch main
1582 Your branch and '\''upstream'\'' have diverged,