]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/show-branch.c
Merge branch 'jt/interpret-branch-name-fallback'
[thirdparty/git.git] / builtin / show-branch.c
index a472862c303e87715c0b21b0c812ff7efad08c09..d6d2dabeca879638109a327eb4c96fbcbf0ecaf7 100644 (file)
@@ -4,7 +4,7 @@
 #include "refs.h"
 #include "builtin.h"
 #include "color.h"
-#include "argv-array.h"
+#include "strvec.h"
 #include "parse-options.h"
 #include "dir.h"
 #include "commit-slab.h"
@@ -20,7 +20,7 @@ static const char* show_branch_usage[] = {
 
 static int showbranch_use_color = -1;
 
-static struct argv_array default_args = ARGV_ARRAY_INIT;
+static struct strvec default_args = STRVEC_INIT;
 
 /*
  * TODO: convert this use of commit->object.flags to commit-slab
@@ -561,9 +561,9 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
                 * default_arg is now passed to parse_options(), so we need to
                 * mimic the real argv a bit better.
                 */
-               if (!default_args.argc)
-                       argv_array_push(&default_args, "show-branch");
-               argv_array_push(&default_args, value);
+               if (!default_args.nr)
+                       strvec_push(&default_args, "show-branch");
+               strvec_push(&default_args, value);
                return 0;
        }
 
@@ -684,9 +684,9 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
        git_config(git_show_branch_config, NULL);
 
        /* If nothing is specified, try the default first */
-       if (ac == 1 && default_args.argc) {
-               ac = default_args.argc;
-               av = default_args.argv;
+       if (ac == 1 && default_args.nr) {
+               ac = default_args.nr;
+               av = default_args.v;
        }
 
        ac = parse_options(ac, av, prefix, builtin_show_branch_options,