Skip to content

Commit

Permalink
Merge pull request #601 from richardfearn/git-sed-spaces-in-filenames
Browse files Browse the repository at this point in the history
git-sed: use "grep -z" and "xargs -0" to cope with spaces in filenames
  • Loading branch information
spacewander authored Nov 20, 2016
2 parents 29a5596 + 2292e1c commit 76694bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/git-sed
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ actual command:
shift
done

command="git grep -l '$search' | xargs sed -i 's/$search/$replacement/$flags'"
git grep -l "$search" | xargs sed -i "s/$search/$replacement/$flags"
command="git grep -lz '$search' | xargs -0 sed -i 's/$search/$replacement/$flags'"
git grep -lz "$search" | xargs -0 sed -i "s/$search/$replacement/$flags"
do_commit

0 comments on commit 76694bc

Please sign in to comment.