To be more pythonic: merged methods create_reference and create_reference_symbolic
and added force-Option. To make a new symbolic reference you have provide symbolic=True
as an additional parameter. If force=True references will although be overridden.
Otherwise an exception is raised if the references exists.
Examples:
# normal reference
repo.create_reference('refs/heads/foo', repo.head.hex)
# override reference with new value
repo.create_reference('refs/heads/foo', repo.head.hex, force=True)
# symbolic reference
repo.create_reference('refs/tags/foo', 'refs/heads/master', symbolic = True)
Features:
- New 'Blob.size' getter
- New 'Repository.create_blob_fromfile' method
- Signature, now the time and offset parameters are optional
- Improved diff support
Other:
- Add 'pygit2.__version__'
- Optimize usage of Travis
- Various fixes for the unit tests
- Various documentation improvements
Thanks to Alex Chamberlain, Carlos Martín Nieto, Eric Davis,
Eric Schrijver, Petr Viktorin, Ridge Kennedy and W. Trevor King.
Moved the hardcoded version from setup.py to pygit2/version.py so
client software can figure out which version of pygit2 it's using.
Having setup.py import pygit2.version.__version__ removes duplication,
and also means that setup.py will always use the local version (and
not the version of a previously installed pygit2).
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
`git_revparse_single` only dates back to
commit ac250c56c7d7bb11691c9dfbcd0dbf580d85e177
Author: Ben Straub <bstraub@github.com>
Date: Wed Apr 25 16:24:22 2012 -0700
First stab at implementation of rev-parse.
which is not included in libgit2 0.17.0. We need to pull in these
patches to work with the current `development` branch of libgit2,
which does include the revparse code.
In both cases, the file contents change from 'X contents\n' to 'X
contents 2\n' (where 'X' is 'a' or 'b'). This means were removing one
line and adding another.
I'm not sure how this test was passing against libgit2 v0.17.0, so I
may be missing something important.
This catches up with changes in libgit2:
commit 9d7ac675d06dab2e000ad32f9248631af0191f85
Author: nulltoken <emeric.fermas@gmail.com>
Date: Tue Aug 21 11:45:16 2012 +0200
tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
This catches up with changes in libgit2:
commit 4bf5115642b64851f9a32a8157010b588bf44103
Author: Ben Straub <bstraub@github.com>
Date: Mon Jul 30 14:52:46 2012 -0700
Enable stats on git_index_read_tree.
Replace with the contents of
git_index_read_tree_with_stats() and improve
documentation comments.
This catches up with changes in libgit2:
commit f335ecd6e126aa9dea28786522c0e6ce71596e91
Author: Russell Belfer <rb@github.com>
Date: Thu Aug 30 14:24:16 2012 -0700
By diffing HEAD~1 with HEAD, we show the effect of the latest commit.
The provided example diffed HEAD with HEAD~1, which shows a diff
that goes back in time.