| 71 | " before the hunks will be merged into one.\n"); |
| 72 | |
| 73 | PyObject * |
| 74 | Blob_diff(Blob *self, PyObject *args, PyObject *kwds) |
| 75 | { |
| 76 | git_diff_options opts = GIT_DIFF_OPTIONS_INIT; |
| 77 | git_patch *patch; |
| 78 | char *old_as_path = NULL, *new_as_path = NULL; |
| 79 | Blob *other = NULL; |
| 80 | int err; |
| 81 | char *keywords[] = {"blob", "flags", "old_as_path", "new_as_path", "context_lines", "interhunk_lines", NULL}; |
| 82 | |
| 83 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!IssHH", keywords, |
| 84 | &BlobType, &other, &opts.flags, |
| 85 | &old_as_path, &new_as_path, |
| 86 | &opts.context_lines, &opts.interhunk_lines)) |
| 87 | return NULL; |
| 88 | |
| 89 | if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load |
| 90 | if (other && Object__load((Object*)other) == NULL) { return NULL; } // Lazy load |
| 91 | |
| 92 | err = git_patch_from_blobs(&patch, self->blob, old_as_path, |
| 93 | other ? other->blob : NULL, new_as_path, |
| 94 | &opts); |
| 95 | if (err < 0) |
| 96 | return Error_set(err); |
| 97 | |
| 98 | return wrap_patch(patch, self, other); |
| 99 | } |
| 100 | |
| 101 | |
| 102 | PyDoc_STRVAR(Blob_diff_to_buffer__doc__, |
nothing calls this directly
no test coverage detected
searching dependent graphs…