git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / 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
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 index

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 ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* 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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git