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

[PATCH] commit-tree: simplify parsing of option -S using skip_prefix()

From
René Scharfe <l.s.r@web.de>
Date
Dec 24, 2014, 00:18 UTC
Message-ID
<549A0643.8090202@web.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 builtin/commit-tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index 8a66c74..25aa2cd 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -66,10 +66,8 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 			continue;
 		}
 
-		if (!memcmp(arg, "-S", 2)) {
-			sign_commit = arg + 2;
+		if (skip_prefix(arg, "-S", &sign_commit))
 			continue;
-		}
 
 		if (!strcmp(arg, "--no-gpg-sign")) {
 			sign_commit = NULL;
-- 
2.2.1
Next: Jonathan Nieder
Message 1 of 2 in “commit-tree: simplify parsing of option -S using skip_prefix()”
  1. commit-tree: simplify parsing of option -S using skip_prefix()René Scharfe, Dec 24, 2014
  2. Jonathan NiederDec 24, 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.