зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
b191fa72ea
Коммит
5a3277133d
|
@ -271,6 +271,8 @@ int main(int argc, char **argv)
|
||||||
int fd[2];
|
int fd[2];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
nr_heads = 0;
|
nr_heads = 0;
|
||||||
heads = NULL;
|
heads = NULL;
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
|
|
|
@ -424,6 +424,8 @@ int main(int argc, char **argv)
|
||||||
int fd[2];
|
int fd[2];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
nr_heads = 0;
|
nr_heads = 0;
|
||||||
heads = NULL;
|
heads = NULL;
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
|
|
|
@ -922,6 +922,8 @@ int main(int argc, char **argv)
|
||||||
int arg = 1;
|
int arg = 1;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 't') {
|
if (argv[arg][1] == 't') {
|
||||||
get_tree = 1;
|
get_tree = 1;
|
||||||
|
|
|
@ -1239,6 +1239,7 @@ int main(int argc, char **argv)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
setup_ident();
|
setup_ident();
|
||||||
|
|
||||||
remote = xmalloc(sizeof(*remote));
|
remote = xmalloc(sizeof(*remote));
|
||||||
|
|
|
@ -207,6 +207,8 @@ int main(int argc, char **argv)
|
||||||
char *commit_id;
|
char *commit_id;
|
||||||
int arg = 1;
|
int arg = 1;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 't')
|
if (argv[arg][1] == 't')
|
||||||
get_tree = 1;
|
get_tree = 1;
|
||||||
|
|
|
@ -273,6 +273,7 @@ int main(int argc, char **argv)
|
||||||
int fd[2], ret;
|
int fd[2], ret;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
argv++;
|
argv++;
|
||||||
for (i = 1; i < argc; i++, argv++) {
|
for (i = 1; i < argc; i++, argv++) {
|
||||||
char *arg = *argv;
|
char *arg = *argv;
|
||||||
|
|
|
@ -131,6 +131,8 @@ int main(int argc, char **argv)
|
||||||
prog = getenv("GIT_SSH_PUSH");
|
prog = getenv("GIT_SSH_PUSH");
|
||||||
if (!prog) prog = "git-ssh-upload";
|
if (!prog) prog = "git-ssh-upload";
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 't') {
|
if (argv[arg][1] == 't') {
|
||||||
get_tree = 1;
|
get_tree = 1;
|
||||||
|
|
|
@ -121,6 +121,9 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
prog = getenv(COUNTERPART_ENV_NAME);
|
prog = getenv(COUNTERPART_ENV_NAME);
|
||||||
if (!prog) prog = COUNTERPART_PROGRAM_NAME;
|
if (!prog) prog = COUNTERPART_PROGRAM_NAME;
|
||||||
|
|
||||||
|
setup_git_directory();
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 'w')
|
if (argv[arg][1] == 'w')
|
||||||
arg++;
|
arg++;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче