Skip to content

Commit 8c6fe0b

Browse files
newrengitster
authored andcommitted
t6423: fix missed staging of file in testcases 12i,12j,12k
Commit 806f832 (t6423: test directory renames causing rename-to-self, 2021-06-30) introduced testcase 12i-12k but omitted staging one of the files and copy-pasted that mistake to the other tests. This means the merge runs with an unstaged change, even though that isn't related to what is being tested and makes the test look more complicated than it is. The cover letter for the series associated with the above commit noted that these testcases triggered two bugs in merge-recursive but only one in merge-ort; in merge-recursive these testcases also triggered a silent deletion of the file in question when it shouldn't be deleted. What I didn't realize at the time was that the deletion bug in merge-ort was merely being sidestepped by the "relevant renames" optimization but can actually be triggered. A subsequent commit will deal with that additional bug, but it was complicated by the mistaken forgotten staging, so this commit first fixes that issue. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c4ce5e4 commit 8c6fe0b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

t/t6423-merge-rename-directories.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4747,6 +4747,7 @@ test_setup_12i () {
47474747
git switch B &&
47484748
git mv source/bar source/subdir/bar &&
47494749
echo more baz >>source/baz &&
4750+
git add source/baz &&
47504751
git commit -m B
47514752
)
47524753
}
@@ -4771,7 +4772,7 @@ test_expect_success '12i: Directory rename causes rename-to-self' '
47714772
git status --porcelain -uno >actual &&
47724773
cat >expect <<-\EOF &&
47734774
UU source/bar
4774-
M source/baz
4775+
M source/baz
47754776
EOF
47764777
test_cmp expect actual
47774778
)
@@ -4806,6 +4807,7 @@ test_setup_12j () {
48064807
git switch B &&
48074808
git mv bar subdir/bar &&
48084809
echo more baz >>baz &&
4810+
git add baz &&
48094811
git commit -m B
48104812
)
48114813
}
@@ -4830,7 +4832,7 @@ test_expect_success '12j: Directory rename to root causes rename-to-self' '
48304832
git status --porcelain -uno >actual &&
48314833
cat >expect <<-\EOF &&
48324834
UU bar
4833-
M baz
4835+
M baz
48344836
EOF
48354837
test_cmp expect actual
48364838
)
@@ -4865,6 +4867,7 @@ test_setup_12k () {
48654867
git switch B &&
48664868
git mv dirA/bar dirB/bar &&
48674869
echo more baz >>dirA/baz &&
4870+
git add dirA/baz &&
48684871
git commit -m B
48694872
)
48704873
}
@@ -4889,7 +4892,7 @@ test_expect_success '12k: Directory rename with sibling causes rename-to-self' '
48894892
git status --porcelain -uno >actual &&
48904893
cat >expect <<-\EOF &&
48914894
UU dirA/bar
4892-
M dirA/baz
4895+
M dirA/baz
48934896
EOF
48944897
test_cmp expect actual
48954898
)
@@ -5114,7 +5117,7 @@ test_expect_failure '12n: Directory rename transitively makes rename back to sel
51145117
grep "CONFLICT (file location).*should perhaps be moved" out &&
51155118
51165119
# Should have 1 entry for hello, and 1 for world
5117-
test_stdout_line_count = 2 git ls-files -s &&
5120+
test_stdout_line_count = 3 git ls-files -s &&
51185121
test_stdout_line_count = 1 git ls-files -s hello &&
51195122
test_stdout_line_count = 2 git ls-files -s world
51205123
)

0 commit comments

Comments
 (0)