Code

docs: fix filter-branch example for quoted paths
authorJeff King <peff@peff.net>
Mon, 1 Feb 2010 12:43:45 +0000 (07:43 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 6 Feb 2010 18:52:14 +0000 (10:52 -0800)
If there is a quoted path, update-index will correctly
unquote it. However, we must take care to put our new prefix
inside the double-quote.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-filter-branch.txt

index cfaba2a3057c8bf3d1e1df965a6becdae6306b2b..020028cf9a54540f5e0e403b52e08dd2921a644e 100644 (file)
@@ -358,7 +358,7 @@ To move the whole tree into a subdirectory, or remove it from there:
 
 ---------------------------------------------------------------
 git filter-branch --index-filter \
-       'git ls-files -s | sed "s-\t-&newsubdir/-" |
+       'git ls-files -s | sed "s-\t\"*-&newsubdir/-" |
                GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
                        git update-index --index-info &&
         mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD