*/
unsigned int flags;
- struct ref_lock *lock;
+ void *backend_data;
unsigned int type;
char *msg;
int do_for_each_ref_iterator(struct ref_iterator *iter,
each_ref_fn fn, void *cb_data);
-/* refs backends */
+/*
+ * Only include per-worktree refs in a do_for_each_ref*() iteration.
+ * Normally this will be used with a files ref_store, since that's
+ * where all reference backends will presumably store their
+ * per-worktree refs.
+ */
+#define DO_FOR_EACH_PER_WORKTREE_ONLY 0x02
struct ref_store;
+/* refs backends */
+
/*
* Initialize the ref_store for the specified submodule, or for the
* main repository if submodule == NULL. These functions should call
*/
typedef struct ref_store *ref_store_init_fn(const char *submodule);
+typedef int ref_init_db_fn(struct ref_store *refs, struct strbuf *err);
+
typedef int ref_transaction_commit_fn(struct ref_store *refs,
struct ref_transaction *transaction,
struct strbuf *err);
const char *logmsg);
typedef int delete_refs_fn(struct ref_store *ref_store,
struct string_list *refnames, unsigned int flags);
+typedef int rename_ref_fn(struct ref_store *ref_store,
+ const char *oldref, const char *newref,
+ const char *logmsg);
/*
* Iterate over the references in the specified ref_store that are
struct ref_storage_be *next;
const char *name;
ref_store_init_fn *init;
+ ref_init_db_fn *init_db;
ref_transaction_commit_fn *transaction_commit;
ref_transaction_commit_fn *initial_transaction_commit;
peel_ref_fn *peel_ref;
create_symref_fn *create_symref;
delete_refs_fn *delete_refs;
+ rename_ref_fn *rename_ref;
ref_iterator_begin_fn *iterator_begin;
read_raw_ref_fn *read_raw_ref;