From e6c111b4c092c0dd24c541b9721f5bc04641dcb0 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 11 Aug 2010 10:38:07 +0200 Subject: unpack_trees: group error messages by type When an error is encountered, it calls add_rejected_file() which either - directly displays the error message and stops if in plumbing mode (i.e. if show_all_errors is not initialized at 1) - or stores it so that it will be displayed at the end with display_error_msgs(), Storing the files by error type permits to have a list of files for which there is the same error instead of having a serie of almost identical errors. As each bind_overlap error combines a file and an old file, a list cannot be done, therefore, theses errors are not stored but directly displayed. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t3030-merge-recursive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t3030-merge-recursive.sh') diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index d541544537..efe2900a37 100755 --- a/t/t3030-merge-recursive.sh +++ b/t/t3030-merge-recursive.sh @@ -294,7 +294,7 @@ test_expect_success 'fail if the index has unresolved entries' ' grep "You have not concluded your merge" out && rm -f .git/MERGE_HEAD && test_must_fail git merge "$c5" 2> out && - grep "Your local changes to .* would be overwritten by merge." out + grep "Your local changes to the following files would be overwritten by merge:" out ' test_expect_success 'merge-recursive remove conflict' ' -- cgit v1.2.3 From d5af51053cd060d7a4893f030626b04351554d1b Mon Sep 17 00:00:00 2001 From: "Schalk, Ken" Date: Wed, 1 Sep 2010 13:15:32 -0700 Subject: RE: [PATCH] Avoid rename/add conflict when contents are identical >Due to this this (and maybe all the tests) need to depend on the >SYMLINKS prereq. Here's a third attempt with no use of symlinks in the test: Skip the entire rename/add conflict case if the file added on the other branch has the same contents as the file being renamed. This avoids giving the user an extra copy of the same file and presenting a conflict that is confusing and pointless. A simple test of this case has been added in t/t3030-merge-recursive.sh. Signed-off-by: Ken Schalk Signed-off-by: Junio C Hamano --- t/t3030-merge-recursive.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 't/t3030-merge-recursive.sh') diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index d541544537..df234f144a 100755 --- a/t/t3030-merge-recursive.sh +++ b/t/t3030-merge-recursive.sh @@ -23,6 +23,8 @@ test_expect_success 'setup 1' ' git branch df-3 && git branch remove && git branch submod && + git branch copy && + git branch rename && echo hello >>a && cp a d/e && @@ -248,6 +250,22 @@ test_expect_success 'setup 7' ' git commit -m "make d/ a submodule" ' +test_expect_success 'setup 8' ' + git checkout rename && + git mv a e && + git add e && + test_tick && + git commit -m "rename a->e" +' + +test_expect_success 'setup 9' ' + git checkout copy && + cp a e && + git add e && + test_tick && + git commit -m "copy a->e" +' + test_expect_success 'merge-recursive simple' ' rm -fr [abcd] && @@ -580,4 +598,21 @@ test_expect_failure 'merge-recursive simple w/submodule result' ' test_cmp expected actual ' +test_expect_success 'merge-recursive copy vs. rename' ' + git checkout -f copy && + git merge rename && + ( git ls-tree -r HEAD && git ls-files -s ) >actual && + ( + echo "100644 blob $o0 b" + echo "100644 blob $o0 c" + echo "100644 blob $o0 d/e" + echo "100644 blob $o0 e" + echo "100644 $o0 0 b" + echo "100644 $o0 0 c" + echo "100644 $o0 0 d/e" + echo "100644 $o0 0 e" + ) >expected && + test_cmp expected actual +' + test_done -- cgit v1.2.3