summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:27 (GMT)
commit69616f7436ed52476180f602727b387408266873 (patch)
treee3af9556382f8d709258f9d3481867de6db9145c /refs.h
parentd3faba840e758e6b5340b59a69e919fec77ce1c3 (diff)
parent49386868de1cebebfb1e9f9527560e17197ad94f (diff)
downloadgit-69616f7436ed52476180f602727b387408266873.zip
git-69616f7436ed52476180f602727b387408266873.tar.gz
git-69616f7436ed52476180f602727b387408266873.tar.bz2
Merge branch 'dt/initial-ref-xn-commit-doc'
* dt/initial-ref-xn-commit-doc: refs: document transaction semantics
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 3c3da29..2f3decb 100644
--- a/refs.h
+++ b/refs.h
@@ -109,6 +109,11 @@ extern int dwim_log(const char *str, int len, unsigned char *sha1, char **ref);
* If this succeeds, the ref updates will have taken place and
* the transaction cannot be rolled back.
*
+ * - Instead of `ref_transaction_commit`, use
+ * `initial_ref_transaction_commit()` if the ref database is known
+ * to be empty (e.g. during clone). This is likely to be much
+ * faster.
+ *
* - At any time call `ref_transaction_free()` to discard the
* transaction and free associated resources. In particular,
* this rolls back the transaction if it has not been
@@ -124,6 +129,13 @@ extern int dwim_log(const char *str, int len, unsigned char *sha1, char **ref);
*
* The message is appended to err without first clearing err.
* err will not be '\n' terminated.
+ *
+ * Caveats
+ * -------
+ *
+ * Note that no locks are taken, and no refs are read, until
+ * `ref_transaction_commit` is called. So `ref_transaction_verify`
+ * won't report a verification failure until the commit is attempted.
*/
struct ref_transaction;