invalid byte sequence in UTF-8 in Windows10 and Windows Server 2016
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The exception is raised in win32_symlink? in lib/overcommit/utils/file_utils.rb around line 67, reached through symlink? and broken_symlink? in lib/overcommit/utils.rb and then store_modified_times in lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb. Start by checking how that code reads the symlink or file output and what encoding it assumes on Windows. Reproducing it needs a Windows setup with a non-UTF-8 default encoding. Done means the pre-commit hook runs on Windows without the 'invalid byte sequence' error and the existing specs still pass.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Ruby
- 星标
- 4k
- 派生
- 288
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 18
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sds/overcommit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
sds/overcommit#909 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
sds/overcommit#847 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 62/100
sds/overcommit#908 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
sds/overcommit#875 ·
维护者通常 1 天内回复
-
help wanted
难度 4/5 3-5 天 新手友好度 18/100
sds/overcommit#869 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
seek4science/seek#2784 ·
维护者通常 2 天内回复
-
Translation tutorial: snippet crashes on chunks export and misses simple { t } entries可能已有人在做 @Mahdi-Hasan 今天认领。 未关闭resource-documentation
难度 2/5 1-3 小时 新手友好度 76/100
TarteelAI/quranic-universal-library#1020 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Records without the CRI logtag raise NoMethodError and are joined into the next record可能已有人在做 @nazarli-shabnam 今天认领。 未关闭bug help wanted
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 82/100
swombat/souls-house#842 ·
维护者通常 1 天内回复