git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Draisey <matt@draisey.ca>
To: git@vger.kernel.org
Subject: [PATCH] local push/pull env cleanup
Date: Thu, 19 Jan 2006 15:58:03 -0500	[thread overview]
Message-ID: <20060119205803.308.78669.stgit@della.draisey.ca> (raw)

From: Matt Draisey <matt@draisey.ca>

remove environment variables relating to the current repository
before execing the 'remote' half of a local push or pull operation
---

 connect.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/connect.c b/connect.c
index d6f4e4c..50cc879 100644
--- a/connect.c
+++ b/connect.c
@@ -644,8 +644,13 @@ int git_connect(int fd[2], char *url, co
 				ssh_basename++;
 			execlp(ssh, ssh_basename, host, command, NULL);
 		}
-		else
+		else {
+			unsetenv("GIT_DIR");
+			unsetenv("GIT_INDEX_FILE");
+			unsetenv("GIT_OBJECT_DIRECTORY");
+			unsetenv("GIT_ALTERNATE_OBJECT_DIRECTORIES");
 			execlp("sh", "sh", "-c", command, NULL);
+		}
 		die("exec failed");
 	}		
 	fd[0] = pipefd[0][0];

             reply	other threads:[~2006-01-19 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19 20:58 Matt Draisey [this message]
2006-01-20  1:13 ` [PATCH] local push/pull env cleanup Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060119205803.308.78669.stgit@della.draisey.ca \
    --to=matt@draisey.ca \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).