summaryrefslogtreecommitdiff
path: root/git.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-15 20:20:35 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-15 20:20:35 -0400
commit129fcfb0e8f955970c9f82a0fcabcb8c6f2a1a0a (patch)
tree5c02b94a8988c4cf4ec3432e42318c7df9f74e24 /git.h
parent5c2d888cbc5d75507640ad988ddfed80e6135b46 (diff)
Added `pull_request`, `file`, and `comment` structs.
These structs are used for accepting, rejecting, creating, sending, and receiving pull requests.
Diffstat (limited to 'git.h')
-rw-r--r--git.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/git.h b/git.h
index 27b6f35..26cf8eb 100644
--- a/git.h
+++ b/git.h
@@ -5,12 +5,40 @@
#include <stdint.h>
typedef struct git_repo git_repo;
+typedef struct pull_request pull_request;
+typedef struct file file;
+typedef struct comment comment;
struct git_repo {
git_repo *next;
git_repository *repo;
};
+struct file {
+ char *name; /* Name of file. */
+ char *buf; /* Buffer containing contents of file. */
+};
+
+struct comment {
+ char *author; /* Author of comment. */
+ char *desc; /* Description/Contents of comment. */
+ int date; /* Date of creation. */
+};
+
+struct pull_request {
+ char *title; /* Title of the pull request. */
+ char *desc; /* Description of the pull request. */
+ char *author; /* Author of the pull request. */
+ comment **comments; /* Comments of this pull reuqest. */
+ int date; /* Date of creation. */
+ uint8_t pr_type; /* Type of pull request. (0 = individual commit patches, 1 = remote branch) */
+ union {
+ file **patches; /* Patch files of pull request. */
+ git_reference *branch; /* Branch of pull request. */
+ };
+ git_reference *merge_branch; /* Branch to merge pull request with. */
+};
+
extern void cleanup_git(git_repository **repos);
extern git_repository **init_git(config *cfg);