7af2897757f15b120c5264cac1e488bece28b752
   1#ifndef REFS_PACKED_BACKEND_H
   2#define REFS_PACKED_BACKEND_H
   3
   4/*
   5 * Support for storing references in a `packed-refs` file.
   6 *
   7 * Note that this backend doesn't check for D/F conflicts, because it
   8 * doesn't care about them. But usually it should be wrapped in a
   9 * `files_ref_store` that prevents D/F conflicts from being created,
  10 * even among packed refs.
  11 */
  12
  13struct ref_store *packed_ref_store_create(const char *path,
  14                                          unsigned int store_flags);
  15
  16/*
  17 * Lock the packed-refs file for writing. Flags is passed to
  18 * hold_lock_file_for_update(). Return 0 on success. On errors, write
  19 * an error message to `err` and return a nonzero value.
  20 */
  21int packed_refs_lock(struct ref_store *ref_store, int flags, struct strbuf *err);
  22
  23void packed_refs_unlock(struct ref_store *ref_store);
  24int packed_refs_is_locked(struct ref_store *ref_store);
  25
  26void add_packed_ref(struct ref_store *ref_store,
  27                    const char *refname, const struct object_id *oid);
  28
  29int commit_packed_refs(struct ref_store *ref_store, struct strbuf *err);
  30
  31int repack_without_refs(struct ref_store *ref_store,
  32                        struct string_list *refnames, struct strbuf *err);
  33
  34#endif /* REFS_PACKED_BACKEND_H */