update->backend_data = lock;
+ if (update->flags & REF_LOG_ONLY)
+ goto out;
+
if (update->type & REF_ISSYMREF) {
if (update->flags & REF_NO_DEREF) {
/*
*/
for (i = 0; i < transaction->nr; i++) {
struct ref_update *update = transaction->updates[i];
- struct string_list_item *item =
- string_list_append(&affected_refnames, update->refname);
+ struct string_list_item *item;
if ((update->flags & REF_IS_PRUNING) &&
!(update->flags & REF_NO_DEREF))
BUG("REF_IS_PRUNING set without REF_NO_DEREF");
+ if (update->flags & REF_LOG_ONLY)
+ continue;
+
+ item = string_list_append(&affected_refnames, update->refname);
/*
* We store a pointer to update in item->util, but at
* the moment we never use the value of this field
/* Fail if a refname appears more than once in the transaction: */
for (i = 0; i < transaction->nr; i++)
- string_list_append(&affected_refnames,
- transaction->updates[i]->refname);
+ if (!(transaction->updates[i]->flags & REF_LOG_ONLY))
+ string_list_append(&affected_refnames,
+ transaction->updates[i]->refname);
string_list_sort(&affected_refnames);
if (ref_update_reject_duplicates(&affected_refnames, err)) {
ret = TRANSACTION_GENERIC_ERROR;
if (ret)
goto done;
- string_list_append(&affected_refnames,
- transaction->updates[i]->refname);
+ if (!(transaction->updates[i]->flags & REF_LOG_ONLY))
+ string_list_append(&affected_refnames,
+ transaction->updates[i]->refname);
}
/*
struct reftable_log_record *logs = NULL;
struct ident_split committer_ident = {0};
size_t logs_nr = 0, logs_alloc = 0, i;
+ uint64_t max_update_index = ts;
const char *committer_info;
int ret = 0;
}
fill_reftable_log_record(log, &c);
- log->update_index = ts;
+
+ /*
+ * Updates are sorted by the writer. So updates for the same
+ * refname need to contain different update indices.
+ */
+ log->update_index = ts + u->index;
+
+ /*
+ * Note the max update_index so the limit can be set later on.
+ */
+ if (log->update_index > max_update_index)
+ max_update_index = log->update_index;
+
log->refname = xstrdup(u->refname);
memcpy(log->value.update.new_hash,
u->new_oid.hash, GIT_MAX_RAWSZ);
* and log blocks.
*/
if (logs) {
+ reftable_writer_set_limits(writer, ts, max_update_index);
+
ret = reftable_writer_add_logs(writer, logs, logs_nr);
if (ret < 0)
goto done;