#ifndef INCLUDE_patch_h__
#define INCLUDE_patch_h__
+#include "common.h"
+
#include "git2/patch.h"
#include "array.h"
size_t content_size;
size_t context_size;
- const git_diff_file *(*newfile)(git_patch *patch);
- const git_diff_file *(*oldfile)(git_patch *patch);
void (*free_fn)(git_patch *patch);
};
size_t *total_dels,
const git_patch *patch);
+/** Options for parsing patch files. */
+typedef struct {
+ /**
+ * The length of the prefix (in path segments) for the filenames.
+ * This prefix will be removed when looking for files. The default is 1.
+ */
+ uint32_t prefix_len;
+} git_patch_options;
+
+#define GIT_PATCH_OPTIONS_INIT { 1 }
+
+extern int git_patch__to_buf(git_str *out, git_patch *patch);
extern void git_patch_free(git_patch *patch);
#endif