overcommit icon indicating copy to clipboard operation
overcommit copied to clipboard

invalid byte sequence in UTF-8 in Windows10 and Windows Server 2016

Open AVarnavskiy opened this issue 4 years ago • 1 comments

Error: C:\Users\artem\Desktop\TestOvercommit\overcommit>git commit -m "fix" invalid byte sequence in UTF-8 C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils/file_utils.rb:67:in win32_symlink?' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils/file_utils.rb:27:in symlink?' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/utils.rb:271:in broken_symlink?' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:65:in block in store_modified_times' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in each' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in store_modified_times' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:11:in setup_environment' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_runner.rb:42:in block in run' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/interrupt_handler.rb:86:in isolate_from_interrupts' C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/overcommit-0.59.1/lib/overcommit/hook_runner.rb:30:in run' .git/hooks/pre-commit:87:in

' Report this bug at https://github.com/sds/overcommit/issues`

.overcommit.yml: PreCommit: RuboCop: enabled: true

please help me to solve the problem

AVarnavskiy avatar Jun 06 '22 18:06 AVarnavskiy

This failure path was removed by #911. The old Windows symlink check parsed localized cmd.exe /c dir output with a UTF-8 regexp, which is the win32_symlink? frame in the report. Current Overcommit uses Ruby's native File.symlink? and File.readlink APIs and no longer parses that command output.

I verified the old method is gone, reran all ten symlink utility examples locally (passing), and checked the complete suite passing on Windows/Ruby 3.3, 3.4, and 4.0 in run 42761227542. Closing as already fixed.

sds avatar Nov 10 '26 05:11 sds