git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] refs.c: rename transaction.updates to transaction.ref_updates

From
Stefan Beller <sbeller@google.com>
Date
Dec 2, 2014, 07:46 UTC
Message-ID
<1417506402-24257-3-git-send-email-sbeller@google.com>
In-Reply-To
<1417506402-24257-1-git-send-email-sbeller@google.com>
The updates are only holding refs not reflogs, so express it to the reader.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
* only renaming, no extra code in this patch.
* new to the series.
 refs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index f0f0d23..58de60c 100644
--- a/refs.c
+++ b/refs.c
@@ -3554,7 +3554,7 @@ enum transaction_state {
  * as atomically as possible.  This structure is opaque to callers.
  */
 struct transaction {
-	struct ref_update **updates;
+	struct ref_update **ref_updates;
 	size_t alloc;
 	size_t nr;
 	enum transaction_state state;
@@ -3575,10 +3575,10 @@ void transaction_free(struct transaction *transaction)
 		return;
 
 	for (i = 0; i < transaction->nr; i++) {
-		free(transaction->updates[i]->msg);
-		free(transaction->updates[i]);
+		free(transaction->ref_updates[i]->msg);
+		free(transaction->ref_updates[i]);
 	}
-	free(transaction->updates);
+	free(transaction->ref_updates);
 	free(transaction);
 }
 
@@ -3589,8 +3589,8 @@ static struct ref_update *add_update(struct transaction *transaction,
 	struct ref_update *update = xcalloc(1, sizeof(*update) + len + 1);
 
 	strcpy((char *)update->refname, refname);
-	ALLOC_GROW(transaction->updates, transaction->nr + 1, transaction->alloc);
-	transaction->updates[transaction->nr++] = update;
+	ALLOC_GROW(transaction->ref_updates, transaction->nr + 1, transaction->alloc);
+	transaction->ref_updates[transaction->nr++] = update;
 	return update;
 }
 
@@ -3712,7 +3712,7 @@ int transaction_commit(struct transaction *transaction,
 	int ret = 0, delnum = 0, i;
 	const char **delnames;
 	int n = transaction->nr;
-	struct ref_update **updates = transaction->updates;
+	struct ref_update **updates = transaction->ref_updates;
 
 	assert(err);
 
-- 
2.2.0
Previous: Jonathan NiederNext: Jonathan Nieder
Message 4 of 12 in “[PATCHv2 0/4] refs.c: use transactions for the reflog”
  1. Stefan BellerDec 2, 2014
  2. 1/4 refs.c: rename the transaction functionsStefan Beller, Dec 2, 2014
  3. Jonathan NiederDec 3, 2014
  4. 2/4 refs.c: rename transaction.updates to transaction.ref_updatesStefan Beller, Dec 2, 2014
  5. Jonathan NiederDec 3, 2014
  6. 3/4 refs.c: add a transaction function to append a reflog entryStefan Beller, Dec 2, 2014
  7. Jonathan NiederDec 3, 2014
  8. Stefan BellerDec 3, 2014
  9. Jonathan NiederDec 3, 2014
  10. 4/4 reflog.c: use a reflog transaction when writing during expireStefan Beller, Dec 2, 2014
  11. Jonathan NiederDec 3, 2014
  12. Junio C HamanoDec 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.