Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-10 20:23:57 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-10 20:23:57 +0300
commit46b225f15308c8f77379f864189bed95c273d29f (patch)
tree8f909ef2df2d002ccd2c86dc2a9dbdf4aae21c95 /refs.c
parentdc04167d378fb29d30e1647ff6ff51dd182bc9a3 (diff)
parentd70a9eb611a9d242c1d26847d223b8677609305b (diff)
Merge branch 'jk/strvec'
The argv_array API is useful for not just managing argv but any "vector" (NULL-terminated array) of strings, and has seen adoption to a certain degree. It has been renamed to "strvec" to reduce the barrier to adoption. * jk/strvec: strvec: rename struct fields strvec: drop argv_array compatibility layer strvec: update documention to avoid argv_array strvec: fix indentation in renamed calls strvec: convert remaining callers away from argv_array name strvec: convert more callers away from argv_array name strvec: convert builtin/ callers away from argv_array name quote: rename sq_dequote_to_argv_array to mention strvec strvec: rename files from argv-array to strvec argv-array: rename to strvec argv-array: use size_t for count and alloc
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 2dd851fe81..9e28912f73 100644
--- a/refs.c
+++ b/refs.c
@@ -15,7 +15,7 @@
#include "tag.h"
#include "submodule.h"
#include "worktree.h"
-#include "argv-array.h"
+#include "strvec.h"
#include "repository.h"
#include "sigchain.h"
@@ -553,13 +553,13 @@ int refname_match(const char *abbrev_name, const char *full_name)
* Given a 'prefix' expand it by the rules in 'ref_rev_parse_rules' and add
* the results to 'prefixes'
*/
-void expand_ref_prefix(struct argv_array *prefixes, const char *prefix)
+void expand_ref_prefix(struct strvec *prefixes, const char *prefix)
{
const char **p;
int len = strlen(prefix);
for (p = ref_rev_parse_rules; *p; p++)
- argv_array_pushf(prefixes, *p, len, prefix);
+ strvec_pushf(prefixes, *p, len, prefix);
}
char *repo_default_branch_name(struct repository *r)
@@ -2050,7 +2050,7 @@ static int run_transaction_hook(struct ref_transaction *transaction,
return ret;
}
- argv_array_pushl(&proc.args, hook, state, NULL);
+ strvec_pushl(&proc.args, hook, state, NULL);
proc.in = -1;
proc.stdout_to_stderr = 1;
proc.trace2_hook_name = "reference-transaction";