Renaming a remote in pygit2 has been done via Remote.name= up to now,
but this is inherently unsafe, as it provides no way to pass up the
refspecs that libgit2 was unable to remap.
In fact, if there ever was such problem, we would have segfaulted.
libgit2 now provides a much more direct way of getting back the results,
so expose it as the return value of Remote.rename(). This also removes
the hint that a rename might be something that happens only to the
in-memory structure.
Reconcile the changes between the ffi changes upstream with the changes
to libgit2 in the dev branch.
Conflicts:
src/config.c
src/options.c
src/refspec.c
src/remote.c
The C API expects a non-NULL new name and raises an assertion if we
don't protect against such input, so let's guard against falsy values,
which also takes care of the empty string, which is also not valid
input.
Pass the contents of the buffer containing the git_oid to bytes() so
build a raw representation of its contents. Using bytes(ffi.buffer(...))
returns the representation of the buffer.
This moves enough code into python with CFFI to pass the test_remotes
unit tests. There is no credentials support yet.
There is a small change in the return value of Remote.fetch() in that we
now return a TransferProgress object instead of extracting a few values
into a dictionary.