]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bisect.c
remote-mediawiki tests: use inline PerlIO for readability
[thirdparty/git.git] / bisect.c
index 1585fcc6ad068b948836003afb60c5009b500f25..d42a3a3767d60bd36af1d57aabd8adc1be5fd378 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -11,7 +11,7 @@
 #include "log-tree.h"
 #include "bisect.h"
 #include "oid-array.h"
-#include "argv-array.h"
+#include "strvec.h"
 #include "commit-slab.h"
 #include "commit-reach.h"
 #include "object-store.h"
@@ -464,7 +464,7 @@ static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
 static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
 static GIT_PATH_FUNC(git_path_head_name, "head-name")
 
-static void read_bisect_paths(struct argv_array *array)
+static void read_bisect_paths(struct strvec *array)
 {
        struct strbuf str = STRBUF_INIT;
        const char *filename = git_path_bisect_names();
@@ -472,7 +472,7 @@ static void read_bisect_paths(struct argv_array *array)
 
        while (strbuf_getline_lf(&str, fp) != EOF) {
                strbuf_trim(&str);
-               if (sq_dequote_to_argv_array(str.buf, array))
+               if (sq_dequote_to_strvec(str.buf, array))
                        die(_("Badly quoted content in file '%s': %s"),
                            filename, str.buf);
        }
@@ -640,7 +640,7 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,
                             const char *bad_format, const char *good_format,
                             int read_paths)
 {
-       struct argv_array rev_argv = ARGV_ARRAY_INIT;
+       struct strvec rev_argv = STRVEC_INIT;
        int i;
 
        repo_init_revisions(r, revs, prefix);
@@ -648,16 +648,16 @@ static void bisect_rev_setup(struct repository *r, struct rev_info *revs,
        revs->commit_format = CMIT_FMT_UNSPECIFIED;
 
        /* rev_argv.argv[0] will be ignored by setup_revisions */
-       argv_array_push(&rev_argv, "bisect_rev_setup");
-       argv_array_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));
+       strvec_push(&rev_argv, "bisect_rev_setup");
+       strvec_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));
        for (i = 0; i < good_revs.nr; i++)
-               argv_array_pushf(&rev_argv, good_format,
-                                oid_to_hex(good_revs.oid + i));
-       argv_array_push(&rev_argv, "--");
+               strvec_pushf(&rev_argv, good_format,
+                            oid_to_hex(good_revs.oid + i));
+       strvec_push(&rev_argv, "--");
        if (read_paths)
                read_bisect_paths(&rev_argv);
 
-       setup_revisions(rev_argv.argc, rev_argv.argv, revs, NULL);
+       setup_revisions(rev_argv.nr, rev_argv.v, revs, NULL);
        /* XXX leak rev_argv, as "revs" may still be pointing to it */
 }
 
@@ -717,7 +717,7 @@ static enum bisect_error bisect_checkout(const struct object_id *bisect_rev, int
        char bisect_rev_hex[GIT_MAX_HEXSZ + 1];
        enum bisect_error res = BISECT_OK;
 
-       memcpy(bisect_rev_hex, oid_to_hex(bisect_rev), the_hash_algo->hexsz + 1);
+       oid_to_hex_r(bisect_rev_hex, bisect_rev);
        update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, UPDATE_REFS_DIE_ON_ERR);
 
        argv_checkout[2] = bisect_rev_hex;