Thread (43 messages) 43 messages, 3 authors, 2025-11-03
STALE238d
Revisions (2)
  1. v4 current
  2. v5 [diff vs current]

[PATCH v4 11/29] rebase: reuse buffer for trailer args

From: Li Chen <hidden>
Date: 2025-10-14 12:26:58
Subsystem: the rest · Maintainer: Linus Torvalds

Reset the reusable buffer before reading trailer
arguments in read_basic_state() so the existing
allocation can be reused.

Signed-off-by: Li Chen <redacted>
---
 builtin/rebase.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 2a2674e375..ff8dd9ec90 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -508,7 +508,7 @@ static int read_basic_state(struct rebase_options *opts)
 		opts->gpg_sign_opt = xstrdup(buf.buf);
 	}
 
-	strbuf_release(&buf);
+	strbuf_reset(&buf);
 
 	if (strbuf_read_file(&buf, state_dir_path("trailer", opts), 0) >= 0) {
 		const char *p = buf.buf, *end = buf.buf + buf.len;
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help