[PATCH v8 02/14] t6060: add tests for removed files

From
Alban Gruin <hidden>
Date
2022-08-09 19:09:37
Reply to
Alban Gruin, 2022-08-09
Until now, t6060 did not not check git-merge-one-file's behaviour when a
file is deleted in a branch.  To avoid regressions on this during the
conversion from shell to C, this adds a new file, `file3', in the commit
tagged as `base', and deletes it in the commit tagged as `two'.

Signed-off-by: Alban Gruin <redacted>
---
 t/t6060-merge-index.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/t6060-merge-index.sh b/t/t6060-merge-index.sh
index d0d6dec0c8..bb4da4bbb2 100755
--- a/t/t6060-merge-index.sh
+++ b/t/t6060-merge-index.sh
@@ -6,12 +6,14 @@ test_description='basic git merge-index / git-merge-one-file tests'
 test_expect_success 'setup diverging branches' '
 	test_write_lines 1 2 3 4 5 6 7 8 9 10 >file &&
 	cp file file2 &&
-	git add file file2 &&
+	cp file file3 &&
+	git add file file2 file3 &&
 	git commit -m base &&
 	git tag base &&
 	sed s/2/two/ <file >tmp &&
 	mv tmp file &&
 	cp file file2 &&
+	git rm file3 &&
 	git commit -a -m two &&
 	git tag two &&
 	git checkout -b other HEAD^ &&
@@ -39,6 +41,7 @@ test_expect_success 'read-tree does not resolve content merge' '
 	cat >expect <<-\EOF &&
 	file
 	file2
+	file3
 	EOF
 	git read-tree -i -m base ten two &&
 	git diff-files --name-only --diff-filter=U >unmerged &&
-- 
2.37.1.412.gcfdce49ffd
Thread (185 messages) 185 messages, 9 authors, last reply 2022-12-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help