22e8817ac412ab1b9e1a1cdc2e38b021f5b4451a
1#ifndef REFS_PACKED_BACKEND_H
2#define REFS_PACKED_BACKEND_H
3
4struct packed_ref_store *packed_ref_store_create(
5 const char *path, unsigned int store_flags);
6
7int packed_read_raw_ref(struct packed_ref_store *refs,
8 const char *refname, unsigned char *sha1,
9 struct strbuf *referent, unsigned int *type);
10
11int packed_peel_ref(struct packed_ref_store *refs,
12 const char *refname, unsigned char *sha1);
13
14struct ref_iterator *packed_ref_iterator_begin(
15 struct packed_ref_store *refs,
16 const char *prefix, unsigned int flags);
17
18/*
19 * Lock the packed-refs file for writing. Flags is passed to
20 * hold_lock_file_for_update(). Return 0 on success. On errors, set
21 * errno appropriately and return a nonzero value.
22 */
23int lock_packed_refs(struct packed_ref_store *refs, int flags);
24
25void add_packed_ref(struct packed_ref_store *refs,
26 const char *refname, const struct object_id *oid);
27
28int commit_packed_refs(struct packed_ref_store *refs);
29
30int repack_without_refs(struct packed_ref_store *refs,
31 struct string_list *refnames, struct strbuf *err);
32
33#endif /* REFS_PACKED_BACKEND_H */