In Dulwich, how do I commit to a branch instead of to HEAD?
Apparently repo.do_commit(message='test commit', committer='Name ') only commits to refs/heads/master.
Is there a way to set the current commit ref to another开发者_StackOverflow社区 one than refs/heads/master?
Or is the only way to commit to a branch by creating a Commit object (as shown in the tutorial in the documentation) and setting it's parent to be the one of the branches commit id?
Should this be true, which would then be the use of repo.do_commit other than committing to refs/heads/master?
Creating a Commit object manually and then setting the tag is indeed the only way to commit to a non-HEAD branch in the last release.
do_commit() in trunk supports a "ref" argument that you can use to commit to other branches.
http://www.samba.org/~jelmer/dulwich/apidocs/dulwich.repo.BaseRepo.html#do_commit
精彩评论