summaryrefslogtreecommitdiff
path: root/builtin-push.c
diff options
context:
space:
mode:
authorUwe Kleine-König <zeisberg@informatik.uni-freiburg.de>2007-01-19 13:46:16 +0100
committerJunio C Hamano <junkio@cox.net>2007-01-19 17:54:33 -0800
commit060aafc11fb6140f1b33326f03e70dad5762a624 (patch)
tree948eefea048d8d12e62a35cda87222140dd52a30 /builtin-push.c
parent18bd8821cace2f830e34574df6df30e072d0ed40 (diff)
downloadgit-060aafc11fb6140f1b33326f03e70dad5762a624.tar.gz
make --exec=... option to git-push configurable
Having to specify git push --exec=... is annoying if you cannot have git-receivepack in your PATH on the remote side (or don't want to). This introduces the config item remote.<name>.receivepack to override the default value (which is "git-receive-pack"). Signed-off-by: Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-push.c')
-rw-r--r--builtin-push.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin-push.c b/builtin-push.c
index ba7981f5bf..6b3c03b8a6 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -143,6 +143,7 @@ static const char *config_repo;
static int config_repo_len;
static int config_current_uri;
static int config_get_refspecs;
+static int config_get_receivepack;
static int get_remote_config(const char* key, const char* value)
{
@@ -157,6 +158,15 @@ static int get_remote_config(const char* key, const char* value)
else if (config_get_refspecs &&
!strcmp(key + 7 + config_repo_len, ".push"))
add_refspec(xstrdup(value));
+ else if (config_get_receivepack &&
+ !strcmp(key + 7 + config_repo_len, ".receivepack")) {
+ if (!execute) {
+ char *ex = xmalloc(strlen(value) + 8);
+ sprintf(ex, "--exec=%s", value);
+ execute = ex;
+ } else
+ error("more than one receivepack given, using the first");
+ }
}
return 0;
}
@@ -168,6 +178,7 @@ static int get_config_remotes_uri(const char *repo, const char *uri[MAX_URI])
config_current_uri = 0;
config_uri = uri;
config_get_refspecs = !(refspec_nr || all || tags);
+ config_get_receivepack = (execute == NULL);
git_config(get_remote_config);
return config_current_uri;