summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-04-25 09:39:54 (GMT)
committerMichael Haggerty <mhagger@alum.mit.edu>2016-06-13 09:23:49 (GMT)
commit71564516deccafba0a58129bd7d3851e28fdb4bb (patch)
treed940e50a24cef10ef33df011309e2aa6e60842a9 /refs
parent3a8af7be8f977cbf393dc77884a9ee6dfd611d95 (diff)
downloadgit-71564516deccafba0a58129bd7d3851e28fdb4bb.zip
git-71564516deccafba0a58129bd7d3851e28fdb4bb.tar.gz
git-71564516deccafba0a58129bd7d3851e28fdb4bb.tar.bz2
add_update(): initialize the whole ref_update
Change add_update() to initialize all of the fields in the new ref_update object. Rename the function to ref_transaction_add_update(), and increase its visibility to all of the refs-related code. All of this makes the function more useful for other future callers. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 'refs')
-rw-r--r--refs/refs-internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 9686e60..babdf27 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -158,6 +158,20 @@ struct ref_update {
};
/*
+ * Add a ref_update with the specified properties to transaction, and
+ * return a pointer to the new object. This function does not verify
+ * that refname is well-formed. new_sha1 and old_sha1 are only
+ * dereferenced if the REF_HAVE_NEW and REF_HAVE_OLD bits,
+ * respectively, are set in flags.
+ */
+struct ref_update *ref_transaction_add_update(
+ struct ref_transaction *transaction,
+ const char *refname, unsigned int flags,
+ const unsigned char *new_sha1,
+ const unsigned char *old_sha1,
+ const char *msg);
+
+/*
* Transaction states.
* OPEN: The transaction is in a valid state and can accept new updates.
* An OPEN transaction can be committed.