mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Rafael Ascensão" <>
Cc: "Rafael Ascensão" <>
Subject: [bug?] clean: Demonstrate failure when used with paths
Date: Fri, 31 May 2019 19:36:51 +0100	[thread overview]
Message-ID: <> (raw)


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/ | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/t/ b/t/
index 7b36954d63..eecbd98906 100755
--- a/t/
+++ b/t/
@@ -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 &&

             reply	other threads:[~2019-05-31 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 18:36 Rafael Ascensão [this message]
2019-06-03 19:57 ` [bug?] clean: Demonstrate failure when used with paths Rafael Ascensão
2019-06-03 20:32   ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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).