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>
Junio C Hamano committed
Nov 26, 2005 at 00:47 UTC
5a3277133d200151fe526e56e036c933d343958a
8 files changed
+15
clone-pack.c
+2
@@ -271,6 +271,8 @@ int main(int argc, char **argv)
271
int fd[2];
272
pid_t pid;
273
274
+ setup_git_directory();
275
+
276
nr_heads = 0;
277
heads = NULL;
278
for (i = 1; i < argc; i++) {
fetch-pack.c
+2
@@ -424,6 +424,8 @@ int main(int argc, char **argv)
424
int fd[2];
425
pid_t pid;
426
427
+ setup_git_directory();
428
+
429
nr_heads = 0;
430
heads = NULL;
431
for (i = 1; i < argc; i++) {
http-fetch.c
+2
@@ -922,6 +922,8 @@ int main(int argc, char **argv)
922
int arg = 1;
923
int rc = 0;
924
925
+ setup_git_directory();
926
+
927
while (arg < argc && argv[arg][0] == '-') {
928
if (argv[arg][1] == 't') {
929
get_tree = 1;
http-push.c
+1
@@ -1239,6 +1239,7 @@ int main(int argc, char **argv)
1239
int rc = 0;
1240
int i;
1241
1242
+ setup_git_directory();
1243
setup_ident();
1244
1245
remote = xmalloc(sizeof(*remote));
local-fetch.c
+2
@@ -207,6 +207,8 @@ int main(int argc, char **argv)
207
char *commit_id;
208
int arg = 1;
209
210
+ setup_git_directory();
211
+
212
while (arg < argc && argv[arg][0] == '-') {
213
if (argv[arg][1] == 't')
214
get_tree = 1;
send-pack.c
+1
@@ -273,6 +273,7 @@ int main(int argc, char **argv)
273
int fd[2], ret;
274
pid_t pid;
275
276
+ setup_git_directory();
277
argv++;
278
for (i = 1; i < argc; i++, argv++) {
279
char *arg = *argv;
ssh-fetch.c
+2
@@ -131,6 +131,8 @@ int main(int argc, char **argv)
131
prog = getenv("GIT_SSH_PUSH");
132
if (!prog) prog = "git-ssh-upload";
133
134
+ setup_git_directory();
135
+
136
while (arg < argc && argv[arg][0] == '-') {
137
if (argv[arg][1] == 't') {
138
get_tree = 1;
ssh-upload.c
+3
@@ -121,6 +121,9 @@ int main(int argc, char **argv)
121
122
prog = getenv(COUNTERPART_ENV_NAME);
123
if (!prog) prog = COUNTERPART_PROGRAM_NAME;
124
+
125
+ setup_git_directory();
126
+
127
while (arg < argc && argv[arg][0] == '-') {
128
if (argv[arg][1] == 'w')
129
arg++;