summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-16 07:57:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-16 07:57:26 (GMT)
commit1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4 (patch)
tree6357e45b20095750fa5665349b5aa598f88ef8a7 /git-filter-branch.sh
parent0ef617f4b6ea78ad63dd11e90f8c854238176981 (diff)
downloadgit-1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4.zip
git-1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4.tar.gz
git-1fe32cb9d0807e6da468dc7bf96d427b2f38c1c4.tar.bz2
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 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index ff716ca..49e13f0 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -276,10 +276,11 @@ while read commit parents; do
eval "$filter_tree" < /dev/null ||
die "tree filter failed: $filter_tree"
- git diff-index -r $commit | cut -f 2- | tr '\012' '\000' | \
- xargs -0 git update-index --add --replace --remove
- git ls-files -z --others | \
- xargs -0 git update-index --add --replace --remove
+ (
+ git diff-index -r --name-only $commit
+ git ls-files --others
+ ) |
+ git update-index --add --replace --remove --stdin
fi
eval "$filter_index" < /dev/null ||