The previous test always passed, because bool(HEAD_SHA) is True.
The update to HEAD_SHA should have happened in:
commit c06e10e67e746099b8d454212acc56391199eb31
Author: Petr Hosek <p.hosek@imperial.ac.uk>
Date: Tue May 29 17:41:07 2012 +0100
Support for diff merge operation added
Allows Repository_getitem, Repository_read(_raw), Repository_create_commit,
Repository_create_tag and Object_read_raw to use short hex strings to
lookup objects.
Also test getting objects from Repository using prefixes, looking up commit
trees and parents by hex prefix, and looking up tag targets by prefix.
Also stop raising TypeError if passing a too-short hex prefix to the
lookup functions, instead use ValueError.
There were two problems:
- Windows refuses to remove a file that is in use. Solution, close
the repo before cleaning the temporary directory.
- Windows refuses to remove a read-only file. Solution, change mode
to writable.
- create_repository
- IndexEntry.path
- Correct SHAs in Index iteration
- Opening a bare index & attempting to add to it
- Walker.reset
- Walker.push
- Walker.sort
Adjusted py_str_to_git_oid to allow 20 byte binary strings. This improves usability to other clients which already store their shas as binary strings, increasing overall performance as they won't have to convert them into hex beforehand, which would have to be converted back to binary form by libgit2 in turn.
Adjusted tests to accept binary shas.