git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [bug?] clean: Demonstrate failure when used with paths
@ 2019-05-31 18:36 Rafael Ascensão
  2019-06-03 19:57 ` Rafael Ascensão
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael Ascensão @ 2019-05-31 18:36 UTC (permalink / raw)
  To: git; +Cc: Rafael Ascensão

---

Yesterday on #git, an user reported the following behaviour of
git clean:

    $ git init
    $ mkdir foo
    $ touch a.txt b.txt bar.txt foo/qux.txt

    $ git clean -f bar.txt foo/qux.txt
    Removing bar.txt

Where the behaviour they expected would be:

    $ git clean -f bar.txt foo/qux.txt
    Removing bar.txt
    Removing foo/qux.txt

Sending this "patch" as an excuse to not forget this bug report.

 t/t7300-clean.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 7b36954d63..eecbd98906 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -92,6 +92,20 @@ test_expect_success 'git clean src/ src/' '
 
 '
 
+test_expect_failure 'git clean a.out docs/manual.tmp' '
+	mkdir -p build docs &&
+	touch a.out b.out docs/manual.txt docs/manual.tmp &&
+	git clean a.out docs/manual.tmp &&
+	test -f Makefile &&
+	test -f README &&
+	test ! -f a.out &&
+	test -f b.out &&
+	test -f docs/manual.txt &&
+	test ! -f docs/manual.tmp &&
+	test -f src/part2.c &&
+	test -f src/part1.c
+'
+
 test_expect_success 'git clean with prefix' '
 
 	mkdir -p build docs src/test &&
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-03 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 18:36 [bug?] clean: Demonstrate failure when used with paths Rafael Ascensão
2019-06-03 19:57 ` Rafael Ascensão
2019-06-03 20:32   ` Elijah Newren

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).