blob: 79ac9a8498383b971107f4b30a7a75dbd30613d1 [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;
9
Junio C Hamano5d23e132007-04-09 17:01:27 -070010struct patch_id {
Kevin Willforddfb7a1b2016-07-29 12:19:17 -040011 struct hashmap_entry ent;
Brandon Williams34f3c0e2017-05-30 10:30:53 -070012 struct object_id patch_id;
Kevin Willford683f17e2016-07-29 12:19:18 -040013 struct commit *commit;
Junio C Hamano5d23e132007-04-09 17:01:27 -070014};
15
16struct patch_ids {
Kevin Willforddfb7a1b2016-07-29 12:19:17 -040017 struct hashmap patches;
Junio C Hamano5d23e132007-04-09 17:01:27 -070018 struct diff_options diffopts;
Junio C Hamano5d23e132007-04-09 17:01:27 -070019};
20
Xiaolong Yeded2c092016-04-26 15:51:21 +080021int commit_patch_id(struct commit *commit, struct diff_options *options,
Brandon Williams34f3c0e2017-05-30 10:30:53 -070022 struct object_id *oid, int);
Junio C Hamano5d23e132007-04-09 17:01:27 -070023int init_patch_ids(struct patch_ids *);
24int free_patch_ids(struct patch_ids *);
25struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
26struct patch_id *has_commit_patch_id(struct commit *, struct patch_ids *);
27
28#endif /* PATCH_IDS_H */