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

2 messages from 2014-12-24 to 2014-12-24. Participants: René Scharfe, Jonathan Nieder.
Thread: https://gitlist.dev/t/38239

## René Scharfe, 2014-12-24 00:18

Subject: [PATCH] commit-tree: simplify parsing of option -S using skip_prefix()
Message-ID: <549A0643.8090202@web.de>
URL: https://gitlist.dev/e/549A0643.8090202%40web.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

```

## Jonathan Nieder, 2014-12-24 02:06

Subject: Re: [PATCH] commit-tree: simplify parsing of option -S using skip_prefix()
Message-ID: <20141224020613.GB29365@google.com>
URL: https://gitlist.dev/e/20141224020613.GB29365%40google.com
In-Reply-To: <549A0643.8090202@web.de>

```
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.

```
