@@ -255,11 +255,31 @@ enum action_on_err {
255
255
struct ref_transaction * ref_transaction_begin (struct strbuf * err );
256
256
257
257
/*
258
- * The following functions add a reference check or update to a
259
- * ref_transaction. In all of them, refname is the name of the
260
- * reference to be affected. The functions make internal copies of
261
- * refname and msg, so the caller retains ownership of these parameters.
262
- * flags can be REF_NODEREF; it is passed to update_ref_lock().
258
+ * Reference transaction updates
259
+ *
260
+ * The following four functions add a reference check or update to a
261
+ * ref_transaction. They have some common similar parameters:
262
+ *
263
+ * transaction -- a pointer to an open ref_transaction, obtained
264
+ * from ref_transaction_begin().
265
+ *
266
+ * refname -- the name of the reference to be affected.
267
+ *
268
+ * flags -- flags affecting the update, passed to
269
+ * update_ref_lock(). Can be REF_NODEREF, which means that
270
+ * symbolic references should not be followed.
271
+ *
272
+ * msg -- a message describing the change (for the reflog).
273
+ *
274
+ * err -- a strbuf for receiving a description of any error that
275
+ * might have occured.
276
+ *
277
+ * The functions make internal copies of refname and msg, so the
278
+ * caller retains ownership of these parameters.
279
+ *
280
+ * The functions return 0 on success and non-zero on failure. A
281
+ * failure means that the transaction as a whole has failed and needs
282
+ * to be rolled back.
263
283
*/
264
284
265
285
/*
@@ -273,9 +293,8 @@ struct ref_transaction *ref_transaction_begin(struct strbuf *err);
273
293
* whole transaction fails. If old_sha1 is NULL, then the previous
274
294
* value is not checked.
275
295
*
276
- * Return 0 on success and non-zero on failure. Any failure in the
277
- * transaction means that the transaction as a whole has failed and
278
- * will need to be rolled back.
296
+ * See the above comment "Reference transaction updates" for more
297
+ * information.
279
298
*/
280
299
int ref_transaction_update (struct ref_transaction * transaction ,
281
300
const char * refname ,
@@ -285,13 +304,13 @@ int ref_transaction_update(struct ref_transaction *transaction,
285
304
struct strbuf * err );
286
305
287
306
/*
288
- * Add a reference creation to transaction. new_sha1 is the value
289
- * that the reference should have after the update; it must not be the
290
- * null SHA-1. It is verified that the reference does not exist
307
+ * Add a reference creation to transaction. new_sha1 is the value that
308
+ * the reference should have after the update; it must not be
309
+ * null_sha1. It is verified that the reference does not exist
291
310
* already.
292
- * Function returns 0 on success and non-zero on failure. A failure to create
293
- * means that the transaction as a whole has failed and will need to be
294
- * rolled back .
311
+ *
312
+ * See the above comment "Reference transaction updates" for more
313
+ * information .
295
314
*/
296
315
int ref_transaction_create (struct ref_transaction * transaction ,
297
316
const char * refname ,
@@ -300,12 +319,12 @@ int ref_transaction_create(struct ref_transaction *transaction,
300
319
struct strbuf * err );
301
320
302
321
/*
303
- * Add a reference deletion to transaction. If old_sha1 is non-NULL, then
304
- * it holds the value that the reference should have had before
305
- * the update (which must not be the null SHA-1 ).
306
- * Function returns 0 on success and non-zero on failure. A failure to delete
307
- * means that the transaction as a whole has failed and will need to be
308
- * rolled back .
322
+ * Add a reference deletion to transaction. If old_sha1 is non-NULL,
323
+ * then it holds the value that the reference should have had before
324
+ * the update (which must not be null_sha1 ).
325
+ *
326
+ * See the above comment "Reference transaction updates" for more
327
+ * information .
309
328
*/
310
329
int ref_transaction_delete (struct ref_transaction * transaction ,
311
330
const char * refname ,
@@ -316,9 +335,10 @@ int ref_transaction_delete(struct ref_transaction *transaction,
316
335
/*
317
336
* Verify, within a transaction, that refname has the value old_sha1,
318
337
* or, if old_sha1 is null_sha1, then verify that the reference
319
- * doesn't exist. old_sha1 must be non-NULL. Function returns 0 on
320
- * success and non-zero on failure. A failure to verify means that the
321
- * transaction as a whole has failed and will need to be rolled back.
338
+ * doesn't exist. old_sha1 must be non-NULL.
339
+ *
340
+ * See the above comment "Reference transaction updates" for more
341
+ * information.
322
342
*/
323
343
int ref_transaction_verify (struct ref_transaction * transaction ,
324
344
const char * refname ,
0 commit comments