Skip to content

Commit

Permalink
Rename git_branch_lookup to simply branch_lookup.
Browse files Browse the repository at this point in the history
As recommended by @jdavid at libgit2#221.
  • Loading branch information
drodriguez committed May 5, 2013
1 parent 1c1600d commit 74437e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pygit2/repository.py
Expand Up @@ -99,13 +99,13 @@ def __init__(self, repository, branch_type):
self._branch_type = branch_type

def __getitem__(self, key):
value = self._repository.git_branch_lookup(key, self._branch_type)
value = self._repository.branch_lookup(key, self._branch_type)
if value is None:
raise KeyError(key)
return value

def __contains__(self, key):
return self._repository.git_branch_lookup(key, self._branch_type) is not None
return self._repository.branch_lookup(key, self._branch_type) is not None

@property
def branches(self):
Expand Down
8 changes: 4 additions & 4 deletions src/repository.c
Expand Up @@ -268,13 +268,13 @@ Repository_git_object_lookup_prefix(Repository *self, PyObject *key)
}


PyDoc_STRVAR(Repository_git_branch_lookup__doc__,
"git_branch_lookup(branch_name, [branch_type]) -> Object\n"
PyDoc_STRVAR(Repository_branch_lookup__doc__,
"branch_lookup(branch_name, [branch_type]) -> Object\n"
"\n"
"Returns the Git reference for the given branch name (local or remote).");

PyObject *
Repository_git_branch_lookup(Repository *self, PyObject *args)
Repository_branch_lookup(Repository *self, PyObject *args)
{
git_reference *c_reference;
const char *c_name;
Expand Down Expand Up @@ -1360,7 +1360,7 @@ PyMethodDef Repository_methods[] = {
METHOD(Repository, create_note, METH_VARARGS),
METHOD(Repository, lookup_note, METH_VARARGS),
METHOD(Repository, git_object_lookup_prefix, METH_O),
METHOD(Repository, git_branch_lookup, METH_VARARGS),
METHOD(Repository, branch_lookup, METH_VARARGS),
METHOD(Repository, listall_branches, METH_VARARGS),
METHOD(Repository, create_branch, METH_VARARGS),
{NULL}
Expand Down

0 comments on commit 74437e4

Please sign in to comment.