Skip to content

Commit daf4994

Browse files
committed
tests: fix existing tests when add an ignore=all submodule
There are tests that rely on "git add <submodule>" also adds it. A --force is needed with this enhancement hence they are added accordingly in these tests. Updated tests: - t1013-read-tree-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>
1 parent eecd21d commit daf4994

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

t/lib-submodule-update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ create_lib_submodule_repo () {
9595
git commit -m "modified file2 and added file3" &&
9696
git push origin modifications
9797
) &&
98-
git add sub1 &&
98+
git add --force sub1 &&
9999
git commit -m "Modify sub1" &&
100100

101101
git checkout -b add_nested_sub modify_sub1 &&
102102
git -C sub1 checkout -b "add_nested_sub" &&
103103
git -C sub1 submodule add --branch no_submodule ../submodule_update_sub2 sub2 &&
104104
git -C sub1 commit -a -m "add a nested submodule" &&
105-
git add sub1 &&
105+
git add --force sub1 &&
106106
git commit -a -m "update submodule, that updates a nested submodule" &&
107107
git checkout -b modify_sub1_recursively &&
108108
git -C sub1 checkout -b modify_sub1_recursively &&
@@ -112,7 +112,7 @@ create_lib_submodule_repo () {
112112
git -C sub1/sub2 commit -m "make a change in nested sub" &&
113113
git -C sub1 add sub2 &&
114114
git -C sub1 commit -m "update nested sub" &&
115-
git add sub1 &&
115+
git add --force sub1 &&
116116
git commit -m "update sub1, that updates nested sub" &&
117117
git -C sub1 push origin modify_sub1_recursively &&
118118
git -C sub1/sub2 push origin modify_sub1_recursively &&

t/t7508-status.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ test_expect_success 'git commit will commit a staged but ignored submodule' '
15651565

15661566
test_expect_success 'git commit --dry-run will show a staged but ignored submodule' '
15671567
git reset HEAD^ &&
1568-
git add sm &&
1568+
git add --force sm &&
15691569
cat >expect << EOF &&
15701570
On branch main
15711571
Your branch and '\''upstream'\'' have diverged,

0 commit comments

Comments
 (0)