All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael Ascensão" <rafa.almas@gmail.com>
To: git@vger.kernel.org
Cc: "Rafael Ascensão" <rafa.almas@gmail.com>
Subject: [bug?] clean: Demonstrate failure when used with paths
Date: Fri, 31 May 2019 19:36:51 +0100	[thread overview]
Message-ID: <20190531183651.10067-1-rafa.almas@gmail.com> (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/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


             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20190531183651.10067-1-rafa.almas@gmail.com \
    --to=rafa.almas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.