This change adds `Repository.revert_commit()` which wraps around
`git_revert_commit` which will return an `Index` with the appropriate
changes to revert the specified commit.
Fixes #710
In a recent commit to libgit2, binary diffs were changed to have a
trailing empty line. This broke a test in test_diff because it compares
it directly against the string. I've added the extra line to the
expected output and the test now passes correctly.
This mirrors the _message attribute for Tag, which gives you the raw
bytes from the entry name. Useful to parse repos where some filenames
aren't encoded as utf-8, such as https://github.com/wuts/earthquake.
This represents what's going on much better than the remnants from the
older methods. What we do is pass a list of callbacks to libgit2 for it
to call, and they are valid for a single operation, not for the remote
itself.
This should also make it easier to re-use callbacks which have already
been set up.
Adding the binary diff flag GIT_DIFF_SHOW_BINARY to pygit2.
libgit2 0.23.0 already supports this constant to be used in diff
flags and produces properly formated binary diffs.
The path test/data/testrepo was mistakenly added as a submodule and the
error was not caught before merging. Remove this path as it should not
exist on the repo.
When merging index entries where the corresponding files contain Unicode
codepoints an error is thrown. Decode the C string using UTF-8 to fix the issue
and adjust the test case for merging files to contain umlauts to catch such
errors.
The function we were using `git_tree_entry_cmp()` is only meant for
git-compatible sorting in a tree and thus does not take the id into
account. This is however important in order to keep value equality. In
order to avoid issues with assymetry, we compare the id any time when
two entries are equal according to their position in a tree.
This allows us to generate a textual diff of conflicting files in
bare repositories by performing a merge on the index followed by
repo.merge_file_from_index on the resulting index entries.