{"thread":{"id":"35712","subject":"[PATCH] t3030-merge-recursive: Test known breakage with empty work tree","startedAt":"2014-01-22T20:11:59Z","lastAt":"2014-01-22T20:11:59Z","messageCount":1,"participants":["Brad King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"233538","messageId":"bee33fbfe83408a69085d58db302b3e72edf16a4.1390421446.git.brad.king@kitware.com","threadId":"35712","inReplyTo":null,"subject":"[PATCH] t3030-merge-recursive: Test known breakage with empty work tree","fromName":"Brad King","fromEmail":"brad.king@kitware.com","sentAt":"2014-01-22T20:11:59Z","receivedAt":"2014-01-22T20:11:59Z","isPatch":true,"sender":{"key":"brad.king@kitware.com","avatar":"https://avatars.githubusercontent.com/u/87268?v=4"},"body":"Add test cases that use 'merge-recursive' plumbing with a temporary\nindex and empty work tree.  Populate the index using 'read-tree' and\n'update-index --ignore-missing --refresh' to prepare for merge without\nactually checking all files out to disk.  Verify that each merge\nproduces its expected tree while displaying no error diagnostics.\n\nThis approach can be used to compute tree merges while checking out only\nconflicting files to disk (which is useful for server-side scripts).\nPrior to commit 5b448b85 (merge-recursive: When we detect we can skip an\nupdate, actually skip it, 2011-08-11) this worked cleanly in all cases.\nSince that commit, merge-recursive displays a diagnostic such as\n\n error: addinfo_cache failed for path 'e'\n\nwhen \"our\" side has a rename (to 'e').  The diagnostic does not\ninfluence the return code and the merge appears to succeed, but it\ncauses this test case to fail.\n\nSigned-off-by: Brad King <brad.king@kitware.com>\n---\n t/t3030-merge-recursive.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)\n\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex 2f96100..b6d3ed0 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -257,6 +257,7 @@ test_expect_success 'setup 8' '\n \tgit add e &&\n \ttest_tick &&\n \tgit commit -m \"rename a->e\" &&\n+\tc7=$(git rev-parse --verify HEAD) &&\n \tgit checkout rename-ln &&\n \tgit mv a e &&\n \ttest_ln_s_add e a &&\n@@ -517,6 +518,52 @@ test_expect_success 'reset and bind merge' '\n \n '\n \n+test_expect_failure 'merge-recursive w/ empty work tree - ours has rename' '\n+\t(\n+\t GIT_WORK_TREE=\"$PWD/ours-has-rename-work\" &&\n+\t export GIT_WORK_TREE &&\n+\t GIT_INDEX_FILE=\"$PWD/ours-has-rename-index\" &&\n+\t export GIT_INDEX_FILE &&\n+\t mkdir \"$GIT_WORK_TREE\" &&\n+\t git read-tree -i -m $c7 &&\n+\t git update-index --ignore-missing --refresh &&\n+\t git merge-recursive $c0 -- $c7 $c3 &&\n+\t git ls-files -s >actual-files\n+\t) 2>actual-err &&\n+\t>expected-err &&\n+\tcat >expected-files <<-EOF &&\n+\t100644 $o3 0\tb/c\n+\t100644 $o0 0\tc\n+\t100644 $o0 0\td/e\n+\t100644 $o0 0\te\n+\tEOF\n+\ttest_cmp expected-files actual-files &&\n+\ttest_cmp expected-err actual-err\n+'\n+\n+test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '\n+\t(\n+\t GIT_WORK_TREE=\"$PWD/theirs-has-rename-work\" &&\n+\t export GIT_WORK_TREE &&\n+\t GIT_INDEX_FILE=\"$PWD/theirs-has-rename-index\" &&\n+\t export GIT_INDEX_FILE &&\n+\t mkdir \"$GIT_WORK_TREE\" &&\n+\t git read-tree -i -m $c3 &&\n+\t git update-index --ignore-missing --refresh &&\n+\t git merge-recursive $c0 -- $c3 $c7 &&\n+\t git ls-files -s >actual-files\n+\t) 2>actual-err &&\n+\t>expected-err &&\n+\tcat >expected-files <<-EOF &&\n+\t100644 $o3 0\tb/c\n+\t100644 $o0 0\tc\n+\t100644 $o0 0\td/e\n+\t100644 $o0 0\te\n+\tEOF\n+\ttest_cmp expected-files actual-files &&\n+\ttest_cmp expected-err actual-err\n+'\n+\n test_expect_success 'merge removes empty directories' '\n \n \tgit reset --hard master &&\n-- \n1.8.5.2\n"}]}