Skip to content

Commit 9180dde

Browse files
committed
Set LC_ALL=C when using sed on a binary file
Because some sed implementations, at least the one on macOS, detect invalid text in the current locale's encoding and error out. See: https://stackoverflow.com/questions/19242275/re-error-illegal-byte-sequence-on-mac-os-x This makes the script work on macOS.
1 parent 474bf0d commit 9180dde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gix-worktree/tests/fixtures/make_traverse_dotdot_trees.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ for subdir in .a .b .c .d .e .f .g .h .i .j; do
2929

3030
standin_pattern="$(printf '%s' "$standin" | sed 's|\.|\\\.|g')"
3131
cp .git/index old_index
32-
sed "s|$standin_pattern|$target|g" old_index >.git/index
32+
LC_ALL=C sed "s|$standin_pattern|$target|g" old_index >.git/index
3333
done
3434

3535
git commit -m 'Initial commit'

0 commit comments

Comments
 (0)