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

[PATCH 1/2] refs: adapt `initial_transaction` flag to be unsigned

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 25, 2024, 07:34 UTC
Message-ID
<20241125-pks-refs-migration-optimization-followup-v1-1-0e1b4a2af384@pks.im>
In-Reply-To
<20241125-pks-refs-migration-optimization-followup-v1-0-0e1b4a2af384@pks.im>

The `initial_transaction` flag is tracked as a signed integer, but we typically pass around flags via unsigned integers. Adapt the type accordingly.

Suggested-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 refs.c | 2 +-
 refs.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index 65eea3eb7734d03f09a22e8edfe5074d532398ff..ee870817466b7d6d6a6619ce0baffe17f3d5a39f 100644
--- a/refs.c
+++ b/refs.c
@@ -2325,7 +2325,7 @@ int refs_verify_refname_available(struct ref_store *refs,
 				  const char *refname,
 				  const struct string_list *extras,
 				  const struct string_list *skip,
-				  int initial_transaction,
+				  unsigned int initial_transaction,
 				  struct strbuf *err)
 {
 	const char *slash;
diff --git a/refs.h b/refs.h
index 980bd20cf24e15144aeff991eeba8b27a936d386..95baf194ba9493f4e8f1f70924f0eb713e5bbd49 100644
--- a/refs.h
+++ b/refs.h
@@ -110,7 +110,7 @@ int refs_verify_refname_available(struct ref_store *refs,
 				  const char *refname,
 				  const struct string_list *extras,
 				  const struct string_list *skip,
-				  int initial_transaction,
+				  unsigned int initial_transaction,
 				  struct strbuf *err);
 
 int refs_ref_exists(struct ref_store *refs, const char *refname);
-- 
2.47.0.274.g962d0b743d.dirty
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 2 of 6 in “refs: stylistic improvements to ref migration optimization”
  1. 0/2 refs: stylistic improvements to ref migration optimizationPatrick Steinhardt, Nov 25, 2024
  2. 1/2 refs: adapt `initial_transaction` flag to be unsignedPatrick Steinhardt, Nov 25, 2024
  3. Junio C HamanoNov 26, 2024
  4. 2/2 reftable: rename scratch bufferPatrick Steinhardt, Nov 25, 2024
  5. Christian CouderNov 25, 2024
  6. Junio C HamanoNov 25, 2024

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.