From: Junio C Hamano Date: Wed, 29 Jul 2009 18:31:17 GMT Subject: Re: [PATCH v2] Demonstrate bugs when a directory is replaced with a symlink Message-ID: <7v63dbuyru.fsf@alter.siamese.dyndns.org> In-Reply-To: <3BA20DF9B35F384F8B7395B001EC3FB342402AD9@azsmsx507.amr.corp.intel.com> "Pickens, James E" writes: > This test creates two directories, a/b and a/b-2, then replaces a/b with > a symlink to a/b-2, then merges that change into another branch that > contains an unrelated change. Thanks. > Note that using the resolve strategy instead of recursive makes the > second bug go away, but not the third one. It is better to have separate tests for documentation purposes to help people who track down the breakage in such a case. > +test_expect_failure 'checkout should not have deleted a/b-2/c/d' ' > + test -f a/b-2/c/d > +' > + > +test_expect_success 'clean the work tree and do the merge' ' > + git reset --hard && > + test -f a/b-2/c/d && > + echo x > a/x && > + git add a/x && > + git commit -m x && > + git merge master > +' > + > +test_expect_failure 'merge should not have deleted a/b-2/c/d' ' > + test -f a/b-2/c/d > +' So... test_expect_success 'setup for merge test' ' ... git commit -m x && git tag baseline ' test_expect_success 'do not lose a/b-2/c/d in merge (resolve)' ' git reset --hard && git checkout baseline^0 && git merge -s resolve master ' test_expect_failure 'do not lose a/b-2/c/d in merge (recursive)' ' git reset --hard && git checkout baseline^0 && git merge -s recursive master ' Likewise for the other one.