git diff-index 与路径,它有效吗?
我在我的存储库中处于 master 的顶端。没有局部变化。
git diff-index HEAD -- "*"
正确地不返回任何内容。
但是,
git diff-index HEAD -- "*.c"
返回我所有的 C 文件,就好像存储库根本没有它们一样,如下所示:
:000000 100644 0000000000000000000000000000000000000000 c0054a0b0a441090184a141ee73954a94a2904d5 A block-sha1/sha1.c
:000000 100644 0000000000000000000000000000000000000000 c59b0c98fefefc413c8330715fffcc83142d5b2d A builtin/add.c
:000000 100644 0000000000000000000000000000000000000000 fc43eed36b55e4966796490b8c0a02fae790229c A builtin/annotate.c
:000000 100644 0000000000000000000000000000000000000000 84a8a0b52136c4d1e43ec10f9ef5ed76b7d3c12f A builtin/apply.c
--cached 没有任何帮助。
这是一个错误还是一个功能?
I'm at the tip of master in my repository. No local changes.
git diff-index HEAD -- "*"
correctly returns nothing.
However,
git diff-index HEAD -- "*.c"
returns me all my C files, as if the repository did not have them at all, like so:
:000000 100644 0000000000000000000000000000000000000000 c0054a0b0a441090184a141ee73954a94a2904d5 A block-sha1/sha1.c
:000000 100644 0000000000000000000000000000000000000000 c59b0c98fefefc413c8330715fffcc83142d5b2d A builtin/add.c
:000000 100644 0000000000000000000000000000000000000000 fc43eed36b55e4966796490b8c0a02fae790229c A builtin/annotate.c
:000000 100644 0000000000000000000000000000000000000000 84a8a0b52136c4d1e43ec10f9ef5ed76b7d3c12f A builtin/apply.c
--cached does not help in any way.
Is it a bug or a feature?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论