Re: [PATCH v2] Demonstrate bugs when a directory is replaced with a symlink
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 29, 2009, 18:31 UTC
- Message-ID
- <7v63dbuyru.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <3BA20DF9B35F384F8B7395B001EC3FB342402AD9@azsmsx507.amr.corp.intel.com>
"Pickens, James E" <james.e.pickens@intel.com> 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.
Show 16 quoted lines
> +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.