aboutsummaryrefslogtreecommitdiffstats
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 16:25:12 -0400
committerJunio C Hamano <gitster@pobox.com>2020-07-28 15:02:18 -0700
commitc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (patch)
tree3a97c304c0e0ed4656cc5049ba44b4eb26e87a16 /unpack-trees.c
parentef8d7ac42a6a62d678166fe25ea743315809d2bb (diff)
downloadgit-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.gz
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 'unpack-trees.c')
-rw-r--r--unpack-trees.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 65c3395f0f..323280dd48 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -106,7 +106,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
const char **msgs = opts->msgs;
const char *msg;
- argv_array_init(&opts->msgs_to_free);
+ strvec_init(&opts->msgs_to_free);
if (!strcmp(cmd, "checkout"))
msg = advice_commit_before_merge
@@ -124,7 +124,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please commit your changes or stash them before you %s.")
: _("Your local changes to the following files would be overwritten by %s:\n%%s");
msgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =
- argv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
msgs[ERROR_NOT_UPTODATE_DIR] =
_("Updating the following directories would lose untracked files in them:\n%s");
@@ -145,7 +145,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please move or remove them before you %s.")
: _("The following untracked working tree files would be removed by %s:\n%%s");
msgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] =
- argv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
if (!strcmp(cmd, "checkout"))
msg = advice_commit_before_merge
@@ -163,7 +163,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
"Please move or remove them before you %s.")
: _("The following untracked working tree files would be overwritten by %s:\n%%s");
msgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] =
- argv_array_pushf(&opts->msgs_to_free, msg, cmd, cmd);
+ strvec_pushf(&opts->msgs_to_free, msg, cmd, cmd);
/*
* Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we
@@ -189,7 +189,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
void clear_unpack_trees_porcelain(struct unpack_trees_options *opts)
{
- argv_array_clear(&opts->msgs_to_free);
+ strvec_clear(&opts->msgs_to_free);
memset(opts->msgs, 0, sizeof(opts->msgs));
}