All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Spang <mspang@uwaterloo.ca>
To: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: [PATCH/RFD 4/3] t7300: Tests for git-clean using filenames with spaces/punctuation
Date: Sun, 06 May 2007 14:09:58 -0400	[thread overview]
Message-ID: <463E19F6.9000906@uwaterloo.ca> (raw)
In-Reply-To: <463E1705.2090201@gmail.com>

Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---

This isn't meant for applying, at least until this flaw is fixed.

These tests are failing because ls-files does escaping and clean does
not unescape. Does anyone know of a solution to this?

sed could be used to remove the double quotes and replace escaped characters,
but doing many replacements happens in multiple passes and hence does not
always work as desired.

Is this even properly solvable without making clean a builtin or
writing git-unescape?


 t/t7300-clean.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 1fb3850..3792221 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -7,6 +7,8 @@ test_description='git-clean basic tests'
 
 . ./test-lib.sh
 
+TAB="	"
+
 test_expect_success \
     'setup' \
     "mkdir -p src &&
@@ -123,6 +125,27 @@ test_expect_success \
     test ! -e obj.o &&
     test ! -e build"
 
+test_expect_success \
+    'filenames with spaces' \
+    'touch abc\ def &&
+    touch 123 123\  &&
+    git-add 123 &&
+    git-clean &&
+    test ! -e abc\ def &&
+    test ! -e 123\  &&
+    test -e 123'
+
+test_expect_success \
+    'filenames with escaped characters' \
+    'touch "'"$TAB"'" " " \\ \" \\\\\" \\t &&
+    git-clean &&
+    test ! -e "'"$TAB"'" &&
+    test ! -e " " &&
+    test ! -e \\ &&
+    test ! -e \" &&
+    test ! -e \\\\\" &&
+    test ! -e \\t'
+
 test_expect_failure \
     'clean.requireForce' \
     "mkdir -p build docs &&

  parent reply	other threads:[~2007-05-06 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <463E1705.2090201@gmail.com>
2007-05-06 18:09 ` [PATCH 2/3] dir.c: Omit non-excluded directories with dir->show_ignored Michael Spang
2007-05-06 19:42   ` Linus Torvalds
2007-05-06 20:18     ` Michael Spang
2007-05-07  2:35     ` Michael Spang
2007-05-06 18:09 ` [PATCH 3/3] Fix minor documentation errors Michael Spang
2007-05-06 18:09 ` Michael Spang [this message]
2007-05-06 18:54   ` [PATCH/RFD 4/3] t7300: Tests for git-clean using filenames with spaces/punctuation Junio C Hamano
2007-05-06 19:14     ` Michael Spang

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=463E19F6.9000906@uwaterloo.ca \
    --to=mspang@uwaterloo.ca \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.