Skip to content

Commit d2d66f1

Browse files
peffgitster
authored andcommitted
docs: fix filter-branch example for quoted paths
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab35469 commit d2d66f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/git-filter-branch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ To move the whole tree into a subdirectory, or remove it from there:
358358

359359
---------------------------------------------------------------
360360
git filter-branch --index-filter \
361-
'git ls-files -s | sed "s-\t-&newsubdir/-" |
361+
'git ls-files -s | sed "s-\t\"*-&newsubdir/-" |
362362
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
363363
git update-index --index-info &&
364364
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD

0 commit comments

Comments
 (0)