我正在使用repo.status().items()
标志(-a
)在预提交挂钩中运行git commit -a -m "Test"
,我得到的结果如下:
[('config/git_hooks/pre-commit', 256), ('bin/run_flake8', 256)]
如果我在同一个过程中运行git status
,我会得到:
On branch ops_1331_fix
Your branch is ahead of 'origin/ops_1331_fix' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: bin/run_flake8
modified: config/git_hooks/pre-commit
换句话说,pygit2报告这些文件没有上传,git报告他们正在上演。
我不清楚这是libgit2还是pygit2的问题。我已经尝试过挖掘源代码了,但是它很复杂。为什么会出现这种差异?