aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-15 23:57:26 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-15 23:57:26 -0800
commit1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4 (patch)
tree6357e45b20095750fa5665349b5aa598f88ef8a7 /t
parent0ef617f4b6ea78ad63dd11e90f8c854238176981 (diff)
downloadgit-1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4.tar.gz
git-1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4.tar.xz
filter-branch: handle filenames that need quoting
The command used a very old fashioned construct to extract filenames out of diff-index and ended up corrupting the output. We can simply use --name-only and pipe into --stdin mode of update-index. It's been like that for the past 2 years or so since a94d994 (update-index: work with c-quoted name). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7003-filter-branch.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 5f60b22d8..868babc4b 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -165,4 +165,18 @@ test_expect_success '"map" works in commit filter' '
git rev-parse --verify master
'
+test_expect_success 'Name needing quotes' '
+
+ git checkout -b rerere A &&
+ mkdir foo &&
+ name="れれれ" &&
+ >foo/$name &&
+ git add foo &&
+ git commit -m "Adding a file" &&
+ git filter-branch --tree-filter "rm -fr foo" &&
+ ! git ls-files --error-unmatch "foo/$name" &&
+ test $(git rev-parse --verify rerere) != $(git rev-parse --verify A)
+
+'
+
test_done