| 122 | " Treat buffer as if it had this filename.\n"); |
| 123 | |
| 124 | PyObject * |
| 125 | Blob_diff_to_buffer(Blob *self, PyObject *args, PyObject *kwds) |
| 126 | { |
| 127 | git_diff_options opts = GIT_DIFF_OPTIONS_INIT; |
| 128 | git_patch *patch; |
| 129 | char *old_as_path = NULL, *buffer_as_path = NULL; |
| 130 | const char *buffer = NULL; |
| 131 | Py_ssize_t buffer_len; |
| 132 | int err; |
| 133 | char *keywords[] = {"buffer", "flags", "old_as_path", "buffer_as_path", NULL}; |
| 134 | |
| 135 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "|z#Iss", keywords, |
| 136 | &buffer, &buffer_len, &opts.flags, |
| 137 | &old_as_path, &buffer_as_path)) |
| 138 | return NULL; |
| 139 | |
| 140 | if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load |
| 141 | |
| 142 | err = git_patch_from_blob_and_buffer(&patch, self->blob, old_as_path, |
| 143 | buffer, buffer_len, buffer_as_path, |
| 144 | &opts); |
| 145 | if (err < 0) |
| 146 | return Error_set(err); |
| 147 | |
| 148 | return wrap_patch(patch, self, NULL); |
| 149 | } |
| 150 | |
| 151 | |
| 152 | struct blob_filter_stream { |
nothing calls this directly
no test coverage detected
searching dependent graphs…