]> git.ipfire.org Git - thirdparty/git.git/commitdiff
shell: use skip_prefix() instead of starts_with()
authorRené Scharfe <l.s.r@web.de>
Tue, 26 Nov 2019 15:00:43 +0000 (16:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Nov 2019 02:18:24 +0000 (11:18 +0900)
Get rid of a magic number by using skip_prefix() instead of
starts_with().

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
shell.c

diff --git a/shell.c b/shell.c
index 40084a30130ef844899bc1f3321285afdda82607..54cca7439de636daa37b7f8627c5cdd8bb431703 100644 (file)
--- a/shell.c
+++ b/shell.c
@@ -16,10 +16,10 @@ static int do_generic_cmd(const char *me, char *arg)
        setup_path();
        if (!arg || !(arg = sq_dequote(arg)) || *arg == '-')
                die("bad argument");
-       if (!starts_with(me, "git-"))
+       if (!skip_prefix(me, "git-", &me))
                die("bad command");
 
-       my_argv[0] = me + 4;
+       my_argv[0] = me;
        my_argv[1] = arg;
        my_argv[2] = NULL;