C coding style: indentation fixes

This commit is contained in:
J. David Ibáñez 2013-11-24 11:49:17 +01:00
parent b51bc45c63
commit f26d6bedfe
4 changed files with 27 additions and 26 deletions

View File

@ -71,7 +71,7 @@ diff_get_patch_byindex(git_diff* diff, size_t idx)
PyObject *py_line_origin=NULL, *py_line=NULL;
err = git_patch_from_diff(&patch, diff, idx);
if (err < 0)
if (err < 0)
return Error_set(err);
delta = git_patch_get_delta(patch);
@ -110,7 +110,7 @@ diff_get_patch_byindex(git_diff* diff, size_t idx)
err = git_patch_get_line_in_hunk(&line, patch, i, j);
if (err < 0)
goto cleanup;
goto cleanup;
py_line_origin = to_unicode_n(&line->origin, 1, NULL, NULL);
py_line = to_unicode_n(line->content, line->content_len, NULL, NULL);

View File

@ -72,7 +72,7 @@ PyDoc_STRVAR(Note_oid__doc__,
PyObject *
Note_oid__get__(Note *self)
{
return git_oid_to_python(git_note_oid(self->note));
return git_oid_to_python(git_note_oid(self->note));
}
@ -82,7 +82,7 @@ PyDoc_STRVAR(Note_message__doc__,
PyObject *
Note_message__get__(Note *self)
{
return to_unicode(git_note_message(self->note), NULL, NULL);
return to_unicode(git_note_message(self->note), NULL, NULL);
}
@ -207,7 +207,7 @@ PyTypeObject NoteIterType = {
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
PyObject_SelfIter, /* tp_iter */
(iternextfunc) NoteIter_iternext, /* tp_iternext */
(iternextfunc) NoteIter_iternext, /* tp_iternext */
};

View File

@ -86,7 +86,7 @@ Remote_name__set__(Remote *self, PyObject* py_name)
free(name);
if (err == GIT_OK)
return 0;
return 0;
Error_set(err);
}
@ -116,7 +116,7 @@ Remote_url__set__(Remote *self, PyObject* py_url)
free(url);
if (err == GIT_OK)
return 0;
return 0;
Error_set(err);
}

View File

@ -945,37 +945,37 @@ Repository_listall_branches(Repository *self, PyObject *args)
list = PyList_New(0);
if (list == NULL)
return NULL;
return NULL;
if ((err = git_branch_iterator_new(&iter, self->repo, list_flags)) < 0)
return Error_set(err);
return Error_set(err);
while ((err = git_branch_next(&ref, &type, iter)) == 0) {
PyObject *py_branch_name = to_path(git_reference_shorthand(ref));
git_reference_free(ref);
if (py_branch_name == NULL)
goto on_error;
goto error;
err = PyList_Append(list, py_branch_name);
Py_DECREF(py_branch_name);
if (err < 0)
goto on_error;
goto error;
}
git_branch_iterator_free(iter);
if (err == GIT_ITEROVER)
err = 0;
err = 0;
if (err < 0) {
Py_CLEAR(list);
return Error_set(err);
return Error_set(err);
}
return list;
on_error:
error:
git_branch_iterator_free(iter);
Py_CLEAR(list);
return NULL;
@ -1116,26 +1116,27 @@ Repository_status(Repository *self, PyObject *args)
entry = git_status_byindex(list, i);
if (entry == NULL)
goto on_error;
goto error;
/* We need to choose one of the strings */
path = entry->head_to_index ?
entry->head_to_index->old_file.path :
entry->index_to_workdir->old_file.path;
if (entry->head_to_index)
path = entry->head_to_index->old_file.path;
else
path = entry->index_to_workdir->old_file.path;
status = PyLong_FromLong((long) entry->status);
err = PyDict_SetItemString(dict, path, status);
Py_CLEAR(status);
if (err < 0)
goto on_error;
goto error;
}
git_status_list_free(list);
return dict;
on_error:
error:
git_status_list_free(list);
Py_CLEAR(dict);
return NULL;
@ -1486,14 +1487,14 @@ PyObject* Repository_blame(Repository *self, PyObject *args, PyObject *kwds)
return NULL;
if (value1) {
err = py_oid_to_git_oid_expand(self->repo, value1, &opts.newest_commit);
if (err < 0)
return NULL;
err = py_oid_to_git_oid_expand(self->repo, value1, &opts.newest_commit);
if (err < 0)
return NULL;
}
if (value2) {
err = py_oid_to_git_oid_expand(self->repo, value2, &opts.oldest_commit);
if (err < 0)
return NULL;
err = py_oid_to_git_oid_expand(self->repo, value2, &opts.oldest_commit);
if (err < 0)
return NULL;
}
err = git_blame_file(&blame, self->repo, path, NULL);