私はpygit2を使って非裸のリポジトリに取り組んでいます
index = repo.index
index.read()
# write in test/test.txt
index.add('test/test.txt')
treeid = index.write_tree()
repo.create_commit(
'HEAD',
author, committer,
'test commit',
treeid,
[repo.head.oid]
)
これは成功しましたが、 を実行すると、次のgit status
ようになりました。
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: test/test.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# test/
そして の後git reset --hard
、すべてが修正されます。
pygit でインデックスを正しく更新する方法はありますか?