diff options
author | Lars Hjemli <hjemli@gmail.com> | 2011-06-13 23:05:10 +0000 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2011-06-13 23:05:10 +0000 |
commit | 1b1bf635b59a349a9238a1d63a21d03d9949e185 (patch) | |
tree | 78d1501781d72f0698f673e9c44450e32118d843 /shared.c | |
parent | b88cda6e5b4472fc1bb0ae00d9fb974ec4f61d7a (diff) | |
parent | a1429dbc89f9c0945e32cea9fd3424d2fe56aeab (diff) | |
download | cgit-1b1bf635b59a349a9238a1d63a21d03d9949e185.tar.gz cgit-1b1bf635b59a349a9238a1d63a21d03d9949e185.tar.bz2 cgit-1b1bf635b59a349a9238a1d63a21d03d9949e185.zip |
Merge branch 'lh/clone-url'
Diffstat (limited to 'shared.c')
-rw-r--r-- | shared.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -70,6 +70,7 @@ struct cgit_repo *cgit_add_repo(const char *url) ret->about_filter = ctx.cfg.about_filter; ret->commit_filter = ctx.cfg.commit_filter; ret->source_filter = ctx.cfg.source_filter; + ret->clone_url = ctx.cfg.clone_url; return ret; } @@ -374,7 +375,8 @@ typedef struct { char * value; } cgit_env_var; -static void prepare_env(struct cgit_repo * repo) { +void cgit_prepare_repo_env(struct cgit_repo * repo) +{ cgit_env_var env_vars[] = { { .name = "CGIT_REPO_URL", .value = repo->url }, { .name = "CGIT_REPO_NAME", .value = repo->name }, @@ -395,7 +397,7 @@ static void prepare_env(struct cgit_repo * repo) { fprintf(stderr, warn, p->name, p->value); } -int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo) +int cgit_open_filter(struct cgit_filter *filter) { filter->old_stdout = chk_positive(dup(STDOUT_FILENO), @@ -406,8 +408,6 @@ int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo) close(filter->pipe_fh[1]); chk_non_negative(dup2(filter->pipe_fh[0], STDIN_FILENO), "Unable to use pipe as STDIN"); - if (repo) - prepare_env(repo); execvp(filter->cmd, filter->argv); die("Unable to exec subprocess %s: %s (%d)", filter->cmd, strerror(errno), errno); |