]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git.c
merge-recursive: Correct a comment
[thirdparty/git.git] / git.c
diff --git a/git.c b/git.c
index ef598c3e7053b8dd2859f4d582ce2917a804fe42..df4306d165927085c06083b999d6600fbfd6e18a 100644 (file)
--- a/git.c
+++ b/git.c
@@ -66,7 +66,7 @@ static void commit_pager_choice(void) {
 
 static int handle_options(const char ***argv, int *argc, int *envchanged)
 {
-       int handled = 0;
+       const char **orig_argv = *argv;
 
        while (*argc > 0) {
                const char *cmd = (*argv)[0];
@@ -116,7 +116,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                                *envchanged = 1;
                        (*argv)++;
                        (*argc)--;
-                       handled++;
                } else if (!prefixcmp(cmd, "--git-dir=")) {
                        setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
                        if (envchanged)
@@ -156,9 +155,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 
                (*argv)++;
                (*argc)--;
-               handled++;
        }
-       return handled;
+       return (*argv) - orig_argv;
 }
 
 static int handle_alias(int *argcp, const char ***argv)