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

Re: [PATCH] clean: respect pathspecs with "-d"

From
Simon Ruderich <simon@ruderich.org>
Date
Mar 10, 2014, 20:02 UTC
Message-ID
<20140310200235.GA14112@ruderich.org>
In-Reply-To
<20140310172215.GC29801@sigill.intra.peff.net>
On Mon, Mar 10, 2014 at 01:22:15PM -0400, Jeff King wrote:
Show 9 quoted lines
> +test_expect_success 'git clean -d respects pathspecs' '
> +	mkdir foo &&
> +	mkdir foobar &&
> +	git clean -df foobar &&
> +	test_path_is_dir foo &&
> +	test_path_is_missing foobar
> +'
> +
>  test_done

I think we should also test removing foo, which was also in the original report, to make sure we don't match prefixes, e.g.:

test_expect_success 'git clean -d respects pathspecs' '
	mkdir foo &&
	mkdir foobar &&
	git clean -df foo &&
	test_path_is_missing foo &&
	test_path_is_dir foobar
'

Regards Simon

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
Previous: Jeff KingNext: Jeff King
Message 4 of 6 in “Accidentially deleted directory, bug in git clean -d?”
  1. Robin PedersenMar 10, 2014
  2. clean: respect pathspecs with "-d"Jeff King, Mar 10, 2014
  3. Jeff KingMar 10, 2014
  4. Simon RuderichMar 10, 2014
  5. Jeff KingMar 10, 2014
  6. clean: simplify dir/not-dir logicJeff King, Mar 10, 2014

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.