blob: 82a12b66f8891e5a9a45c2a63845dd28de7eeda7 [file] [log] [blame]
Junio C Hamano5d23e132007-04-09 17:01:27 -07001#ifndef PATCH_IDS_H
2#define PATCH_IDS_H
3
Elijah Newrenef3ca952018-08-15 10:54:05 -07004#include "diff.h"
5#include "hashmap.h"
6
7struct commit;
8struct object_id;
Nguyễn Thái Ngọc Duya7edadd2018-09-21 17:57:30 +02009struct repository;
Elijah Newrenef3ca952018-08-15 10:54:05 -070010
Junio C Hamano5d23e132007-04-09 17:01:27 -070011struct patch_id {
Kevin Willforddfb7a1b2016-07-29 12:19:17 -040012 struct hashmap_entry ent;
Brandon Williams34f3c0e2017-05-30 10:30:53 -070013 struct object_id patch_id;
Kevin Willford683f17e2016-07-29 12:19:18 -040014 struct commit *commit;
Junio C Hamano5d23e132007-04-09 17:01:27 -070015};
16
17struct patch_ids {
Kevin Willforddfb7a1b2016-07-29 12:19:17 -040018 struct hashmap patches;
Junio C Hamano5d23e132007-04-09 17:01:27 -070019 struct diff_options diffopts;
Junio C Hamano5d23e132007-04-09 17:01:27 -070020};
21
Xiaolong Yeded2c092016-04-26 15:51:21 +080022int commit_patch_id(struct commit *commit, struct diff_options *options,
Brandon Williams34f3c0e2017-05-30 10:30:53 -070023 struct object_id *oid, int);
Nguyễn Thái Ngọc Duya7edadd2018-09-21 17:57:30 +020024int init_patch_ids(struct repository *, struct patch_ids *);
Junio C Hamano5d23e132007-04-09 17:01:27 -070025int free_patch_ids(struct patch_ids *);
26struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
27struct patch_id *has_commit_patch_id(struct commit *, struct patch_ids *);
28
29#endif /* PATCH_IDS_H */