Invalid byte sequence in UTF-8

未关闭
#850 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
git, ruby
领域
devtools

调研方向

The trace points to win32_symlink? at lib/overcommit/utils/file_utils.rb:67, reached from store_modified_times in lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64-65 during the pre-commit hook. Start by reading how the file's path or link target is read on Windows, and reproduce on Windows with a commit that has non-ASCII file names or content. Done means the commit completes without 'invalid byte sequence in UTF-8'; the issue has no comments or linked pull request, so confirm the current code still raises it before changing anything.

由索引模型根据 Issue 内容生成。

描述

In rubymine, Windows 11

00:35:49.370: [wardy_bot] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- app/validators/updates/bot_command_validator.rb app/controllers/telegram_webhooks_router.rb app/services/user_panel/profile/chats/moderation/main_service.rb
00:35:49.435: [wardy_bot] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\Danyil\AppData\Local\Temp\git-commit-msg-.txt --
invalid byte sequence in UTF-8
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/utils/file_utils.rb:67:in `win32_symlink?'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/utils/file_utils.rb:27:in `symlink?'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/utils.rb:271:in `broken_symlink?'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:65:in `block in store_modified_times'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in `each'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:64:in `store_modified_times'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_context/helpers/stash_unstaged_changes.rb:11:in `setup_environment'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_runner.rb:42:in `block in run'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/interrupt_handler.rb:86:in `isolate_from_interrupts'
C:/Ruby-on-Windows/3.2.2-1/lib/ruby/gems/3.2.0/gems/overcommit-0.63.0/lib/overcommit/hook_runner.rb:30:in `run'
.git/hooks/pre-commit:87:in `<main>'
主要语言
Ruby
星标
4k
派生
288
平均合并
2 天 4 小时
30 天内合并 PR
18

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sds/overcommit 的其他 Issue

查看 sds/overcommit 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。