git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Pickens, James ENext: Pickens, James E
Message 10 of 18 in “More symlink/directory troubles”
  1. James PickensJul 28, 2009
  2. 1/2 Demonstrate bugs when a directory is replaced with a symlink.James Pickens, Jul 28, 2009
  3. 2/2 Demonstrate merge failure when a directory is replaced with a symlink.James Pickens, Jul 28, 2009
  4. Michael J GruberJul 29, 2009
  5. Pickens, James EJul 29, 2009
  6. Michael J GruberJul 29, 2009
  7. Junio C HamanoJul 29, 2009
  8. Pickens, James EJul 29, 2009
  9. Demonstrate bugs when a directory is replaced with a symlinkPickens, James E, Jul 29, 2009
  10. Junio C HamanoJul 29, 2009
  11. Demonstrate bugs when a directory is replaced with a symlinkPickens, James E, Jul 29, 2009
  12. Linus TorvaldsJul 29, 2009
  13. Junio C HamanoJul 29, 2009
  14. Kjetil BarvikJul 29, 2009
  15. Linus TorvaldsJul 29, 2009
  16. Linus TorvaldsJul 30, 2009
  17. Junio C HamanoJul 30, 2009
  18. Junio C HamanoJul 30, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.