summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:25:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (patch)
tree3a97c304c0e0ed4656cc5049ba44b4eb26e87a16 /revision.c
parentef8d7ac42a6a62d678166fe25ea743315809d2bb (diff)
downloadgit-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.zip
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.gz
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.bz2
strvec: convert remaining callers away from argv_array name
We eventually want to drop the argv_array name and just use strvec consistently. There's no particular reason we have to do it all at once, or care about interactions between converted and unconverted bits. Because of our preprocessor compat layer, the names are interchangeable to the compiler (so even a definition and declaration using different names is OK). This patch converts all of the remaining files, as the resulting diff is reasonably sized. The conversion was done purely mechanically with: git ls-files '*.c' '*.h' | xargs perl -i -pe ' s/ARGV_ARRAY/STRVEC/g; s/argv_array/strvec/g; ' We'll deal with any indentation/style fallouts separately. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/revision.c b/revision.c
index 07e16ed..e144132 100644
--- a/revision.c
+++ b/revision.c
@@ -2073,14 +2073,14 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi
}
static void read_pathspec_from_stdin(struct strbuf *sb,
- struct argv_array *prune)
+ struct strvec *prune)
{
while (strbuf_getline(sb, stdin) != EOF)
- argv_array_push(prune, sb->buf);
+ strvec_push(prune, sb->buf);
}
static void read_revisions_from_stdin(struct rev_info *revs,
- struct argv_array *prune)
+ struct strvec *prune)
{
struct strbuf sb;
int seen_dashdash = 0;
@@ -2675,7 +2675,7 @@ static void NORETURN diagnose_missing_default(const char *def)
int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)
{
int i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;
- struct argv_array prune_data = ARGV_ARRAY_INIT;
+ struct strvec prune_data = STRVEC_INIT;
const char *submodule = NULL;
int seen_end_of_options = 0;
@@ -2694,7 +2694,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
argv[i] = NULL;
argc = i;
if (argv[i + 1])
- argv_array_pushv(&prune_data, argv + i + 1);
+ strvec_pushv(&prune_data, argv + i + 1);
seen_dashdash = 1;
break;
}
@@ -2760,7 +2760,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
for (j = i; j < argc; j++)
verify_filename(revs->prefix, argv[j], j == i);
- argv_array_pushv(&prune_data, argv + i);
+ strvec_pushv(&prune_data, argv + i);
break;
}
else
@@ -2785,7 +2785,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
parse_pathspec(&revs->prune_data, 0, 0,
revs->prefix, prune_data.argv);
}
- argv_array_clear(&prune_data);
+ strvec_clear(&prune_data);
if (revs->def == NULL)
revs->def = opt ? opt->def : NULL;