diff options
author | Junio C Hamano <junkio@cox.net> | 2005-11-26 00:47:59 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-28 23:13:02 -0800 |
commit | 5a3277133d200151fe526e56e036c933d343958a (patch) | |
tree | a33a57bedea85936d19ef8e7a2c62418dc069383 | |
parent | b191fa72ea501c0789fb1bd7a80fcec9da38804d (diff) | |
download | git-5a3277133d200151fe526e56e036c933d343958a.tar.gz git-5a3277133d200151fe526e56e036c933d343958a.tar.xz |
Make networking commands to work from a subdirectory.
These are whole-tree operations and there is not much point
making them operable from within a subdirectory, but it is easy
to do so, and using setup_git_directory() upfront helps git://
proxy specification picked up from the correct place.
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | clone-pack.c | 2 | ||||
-rw-r--r-- | fetch-pack.c | 2 | ||||
-rw-r--r-- | http-fetch.c | 2 | ||||
-rw-r--r-- | http-push.c | 1 | ||||
-rw-r--r-- | local-fetch.c | 2 | ||||
-rw-r--r-- | send-pack.c | 1 | ||||
-rw-r--r-- | ssh-fetch.c | 2 | ||||
-rw-r--r-- | ssh-upload.c | 3 |
8 files changed, 15 insertions, 0 deletions
diff --git a/clone-pack.c b/clone-pack.c index 960921903..a99a95c5f 100644 --- a/clone-pack.c +++ b/clone-pack.c @@ -271,6 +271,8 @@ int main(int argc, char **argv) int fd[2]; pid_t pid; + setup_git_directory(); + nr_heads = 0; heads = NULL; for (i = 1; i < argc; i++) { diff --git a/fetch-pack.c b/fetch-pack.c index 656598266..58ba2094d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -424,6 +424,8 @@ int main(int argc, char **argv) int fd[2]; pid_t pid; + setup_git_directory(); + nr_heads = 0; heads = NULL; for (i = 1; i < argc; i++) { diff --git a/http-fetch.c b/http-fetch.c index 435317342..ad59f1cce 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -922,6 +922,8 @@ int main(int argc, char **argv) int arg = 1; int rc = 0; + setup_git_directory(); + while (arg < argc && argv[arg][0] == '-') { if (argv[arg][1] == 't') { get_tree = 1; diff --git a/http-push.c b/http-push.c index ad789829c..c6e782cbe 100644 --- a/http-push.c +++ b/http-push.c @@ -1239,6 +1239,7 @@ int main(int argc, char **argv) int rc = 0; int i; + setup_git_directory(); setup_ident(); remote = xmalloc(sizeof(*remote)); diff --git a/local-fetch.c b/local-fetch.c index 093110914..fa9e697fd 100644 --- a/local-fetch.c +++ b/local-fetch.c @@ -207,6 +207,8 @@ int main(int argc, char **argv) char *commit_id; int arg = 1; + setup_git_directory(); + while (arg < argc && argv[arg][0] == '-') { if (argv[arg][1] == 't') get_tree = 1; diff --git a/send-pack.c b/send-pack.c index 3eeb18f7c..2a14b0084 100644 --- a/send-pack.c +++ b/send-pack.c @@ -273,6 +273,7 @@ int main(int argc, char **argv) int fd[2], ret; pid_t pid; + setup_git_directory(); argv++; for (i = 1; i < argc; i++, argv++) { char *arg = *argv; diff --git a/ssh-fetch.c b/ssh-fetch.c index bf01fbc00..4eb9e0482 100644 --- a/ssh-fetch.c +++ b/ssh-fetch.c @@ -131,6 +131,8 @@ int main(int argc, char **argv) prog = getenv("GIT_SSH_PUSH"); if (!prog) prog = "git-ssh-upload"; + setup_git_directory(); + while (arg < argc && argv[arg][0] == '-') { if (argv[arg][1] == 't') { get_tree = 1; diff --git a/ssh-upload.c b/ssh-upload.c index 603abcc8c..b675a0b1f 100644 --- a/ssh-upload.c +++ b/ssh-upload.c @@ -121,6 +121,9 @@ int main(int argc, char **argv) prog = getenv(COUNTERPART_ENV_NAME); if (!prog) prog = COUNTERPART_PROGRAM_NAME; + + setup_git_directory(); + while (arg < argc && argv[arg][0] == '-') { if (argv[arg][1] == 'w') arg++; |