Skip to content

Commit

Permalink
Make networking commands to work from a subdirectory.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Nov 29, 2005
1 parent b191fa7 commit 5a32771
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clone-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 2 additions & 0 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 2 additions & 0 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ int main(int argc, char **argv)
int rc = 0;
int i;

setup_git_directory();
setup_ident();

remote = xmalloc(sizeof(*remote));
Expand Down
2 changes: 2 additions & 0 deletions local-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions send-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions ssh-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions ssh-upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 5a32771

Please sign in to comment.