diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-01-12 05:19:52 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-01-12 05:19:52 -0800 |
| commit | 3235ef374ea9808002b3304036c1b31965033ea0 (patch) | |
| tree | 2f82cb718b5447a6021308b4d905c2e8e8c4de22 /commit.h | |
| parent | 0320bcd743ccf9e707b45c84761e94e9ca72f710 (diff) | |
| parent | 0e445956f4c9b6d079feb5ed831f018c857b955b (diff) | |
| download | git-3235ef374ea9808002b3304036c1b31965033ea0.tar.xz | |
Merge branch 'rs/commit-stack'
Code clean-up, unifying various hand-rolled "list of commit
objects" and use the commit_stack API.
* rs/commit-stack:
commit-reach: use commit_stack
commit-graph: use commit_stack
commit: add commit_stack_grow()
shallow: use commit_stack
pack-bitmap-write: use commit_stack
commit: add commit_stack_init()
test-reach: use commit_stack
remote: use commit_stack for src_commits
remote: use commit_stack for sent_tips
remote: use commit_stack for local_commits
name-rev: use commit_stack
midx: use commit_stack
log: use commit_stack
revision: export commit_stack
Diffstat (limited to 'commit.h')
| -rw-r--r-- | commit.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -381,4 +381,16 @@ int parse_buffer_signed_by_header(const char *buffer, const struct git_hash_algo *algop); int add_header_signature(struct strbuf *buf, struct strbuf *sig, const struct git_hash_algo *algo); +struct commit_stack { + struct commit **items; + size_t nr, alloc; +}; +#define COMMIT_STACK_INIT { 0 } + +void commit_stack_init(struct commit_stack *); +void commit_stack_grow(struct commit_stack *, size_t); +void commit_stack_push(struct commit_stack *, struct commit *); +struct commit *commit_stack_pop(struct commit_stack *); +void commit_stack_clear(struct commit_stack *); + #endif /* COMMIT_H */ |
