Merge branch 'master' into oid

This commit is contained in:
J. David Ibáñez
2013-04-19 18:02:50 +02:00
4 changed files with 35 additions and 42 deletions

View File

@@ -45,47 +45,48 @@ for the topic), send a pull request.
Authors Authors
============== ==============
The following people have contributed at least one patch to the This is the list of authors of pygit2, sorted by number of commits (as shown by
pygit2 project (sorted alphabetically): ``git shortlog -sn``):
- J David Ibáñez
- Nico von Geyso
- W Trevor King
- Dave Borowitz
- Carlos Martín Nieto
- Christian Boos
- Julien Miotte
- Richo Healey
- Martin Lenders
- Xavier Delannoy
- Yonggang Luo
- Valentin Haenel
- John Szakmeister
- David Versmisse
- Petr Hosek
- Sebastian Thiel
- Han-Wen Nienhuys
- Petr Viktorin
- Alex Chamberlain - Alex Chamberlain
- Amit Bakshi - Amit Bakshi
- András Veres-Szentkirályi
- Ben Davis - Ben Davis
- Jared Flatow
- Sarath Lakshman
- Vicent Marti
- Zoran Zaric
- András Veres-Szentkirályi
- Benjamin Kircher - Benjamin Kircher
- Benjamin Pollack - Benjamin Pollack
- Bryan O'Sullivan - Bryan O'Sullivan
- Carlos Martín Nieto
- Christian Boos
- David Borowitz (*Original author*)
- David Sanders - David Sanders
- David Versmisse
- Eric Davis - Eric Davis
- Eric Schrijver - Eric Schrijver
- Erik van Zijst - Erik van Zijst
- Ferengee - Ferengee
- Han-Wen Nienhuys
- Hugh Cole-Baker - Hugh Cole-Baker
- J David Ibáñez (*Current maintainer*)
- Jared Flatow
- John Szakmeister
- Josh Bleecher Snyder - Josh Bleecher Snyder
- Julien Miotte - Jun Omae
- Martin Lenders
- Nico von Geyso
- Petr Hosek
- Petr Viktorin
- Richo Healey
- Ridge Kennedy - Ridge Kennedy
- Rui Abreu Ferreira - Rui Abreu Ferreira
- Sarath Lakshman
- Sebastian Thiel
- Valentin Haenel
- Vicent Marti
- W Trevor King
- Xavier Delannoy
- Yonggang Luo
- Zoran Zaric
- pistacchio - pistacchio

View File

@@ -17,6 +17,12 @@ A diff shows the changes between trees, an index or the working dir::
# Diff a tree with the current working dir # Diff a tree with the current working dir
>>> diff = head.tree.diff() >>> diff = head.tree.diff()
# Get all patches for a diff
>>> t0 = repo.revparse_single('HEAD^').tree
>>> t1 = repo.revparse_single('HEAD~3').tree
>>> diff = t0.diff(t1)
>>> patches = [p for p in diff]
The Diff type The Diff type
==================== ====================

View File

@@ -227,7 +227,7 @@ PyTypeObject DiffIterType = {
}; };
PyDoc_STRVAR(Diff_patch__doc__, "Patch."); PyDoc_STRVAR(Diff_patch__doc__, "Patch diff string.");
PyObject * PyObject *
Diff_patch__get__(Diff *self) Diff_patch__get__(Diff *self)

View File

@@ -854,30 +854,15 @@ PyObject *
Repository_git_reference_symbolic_create(Repository *self, PyObject *args, Repository_git_reference_symbolic_create(Repository *self, PyObject *args,
PyObject *kw) PyObject *kw)
{ {
PyObject *py_obj;
git_reference *c_reference; git_reference *c_reference;
char *c_name, *c_target; char *c_name, *c_target;
int err, force; int err, force;
if (!PyArg_ParseTuple(args, "sOi", &c_name, &py_obj, &force)) if (!PyArg_ParseTuple(args, "ssi", &c_name, &c_target, &force))
return NULL;
#if PY_MAJOR_VERSION == 2
c_target = PyBytes_AsString(py_obj);
#else
// increases ref counter, so we have to release it afterwards
PyObject* py_str = PyUnicode_AsASCIIString(py_obj);
c_target = PyBytes_AsString(py_str);
#endif
if (c_target == NULL)
return NULL; return NULL;
err = git_reference_symbolic_create(&c_reference, self->repo, c_name, err = git_reference_symbolic_create(&c_reference, self->repo, c_name,
c_target, force); c_target, force);
#if PY_MAJOR_VERSION > 2
Py_CLEAR(py_str);
#endif
if (err < 0) if (err < 0)
return Error_set(err); return Error_set(err);
@@ -1025,6 +1010,7 @@ Repository_create_remote(Repository *self, PyObject *args)
return Error_set(err); return Error_set(err);
py_remote = PyObject_New(Remote, &RemoteType); py_remote = PyObject_New(Remote, &RemoteType);
Py_INCREF(self);
py_remote->repo = self; py_remote->repo = self;
py_remote->remote = remote; py_remote->remote = remote;