summaryrefslogtreecommitdiffstats
path: root/builtin/for-each-repo.c
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2022-11-09 20:07:07 +0100
committerTaylor Blau <me@ttaylorr.com>2022-11-15 04:39:25 +0100
commit13d5bbdf72aab109c9b69994c90aaff2a0b7e42f (patch)
tree46d3ce66b282fe9c127607e6db5997e2b7b669f5 /builtin/for-each-repo.c
parentThe tenth batch (diff)
downloadgit-13d5bbdf72aab109c9b69994c90aaff2a0b7e42f.tar.xz
git-13d5bbdf72aab109c9b69994c90aaff2a0b7e42f.zip
for-each-repo: interpolate repo path arguments
This is a quality of life change for git-maintenance, so repos can be recorded with the tilde syntax. The register subcommand will not record repos in this format by default. Signed-off-by: Ronan Pigott <ronan@rjp.ie> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'builtin/for-each-repo.c')
-rw-r--r--builtin/for-each-repo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index d45d873f57..6aeac37148 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -14,13 +14,16 @@ static int run_command_on_repo(const char *path, int argc, const char ** argv)
{
int i;
struct child_process child = CHILD_PROCESS_INIT;
+ char *abspath = interpolate_path(path, 0);
child.git_cmd = 1;
- strvec_pushl(&child.args, "-C", path, NULL);
+ strvec_pushl(&child.args, "-C", abspath, NULL);
for (i = 0; i < argc; i++)
strvec_push(&child.args, argv[i]);
+ free(abspath);
+
return run_command(&child);
}