threads / patch / 38239

patchcommit-tree: simplify parsing of option -S using skip_prefix()

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

## tl;dr

2 messages between Dec 24, 2014 and Dec 24, 2014. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

René Scharfe· Dec 24, 2014, 00:18 UTC · lore
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 builtin/commit-tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Show changes to builtin/commit-tree.c +1 −3
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
Jonathan Nieder· Dec 24, 2014, 02:06 UTC · re: René Scharfe · lore

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

René Scharfe wrote:
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
>  builtin/commit-tree.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.

← back to recent threads