git: avoid magic number with skip_prefix
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index b2bb09e40a32b129896192dea808aef8c7cd5604..1537f00bc7081aa800d390aecaf6d80ab7c546c9 100644 (file)
--- a/git.c
+++ b/git.c
@@ -588,8 +588,8 @@ int main(int argc, char **av)
        argc--;
        handle_options(&argv, &argc, NULL);
        if (argc > 0) {
-               if (starts_with(argv[0], "--"))
-                       argv[0] += 2;
+               /* translate --help and --version into commands */
+               skip_prefix(argv[0], "--", &argv[0]);
        } else {
                /* The user didn't specify a command; give them help */
                commit_pager_choice();