# local git push bug wrt GIT_OBJECT_DIRECTORY

2 messages from 2005-12-30 to 2006-01-06. Participants: Matt Draisey, Junio C Hamano.
Thread: https://gitlist.dev/t/2943

## Matt Draisey, 2005-12-30 06:08

Subject: local git push bug wrt GIT_OBJECT_DIRECTORY
Message-ID: <1135922900.2103.37.camel@della.draisey.ca>
URL: https://gitlist.dev/e/1135922900.2103.37.camel%40della.draisey.ca

```
Using git-send-pack to push to a local repository will propagate the
environment variable GIT_OBJECT_DIRECTORY to git-receive-pack.
git-receive-pack correctly ignores GIT_DIR (as opposed to what the
documentation says) but, unfortunately, honours GIT_OBJECT_DIRECTORY.

It's not clear to me whether the correct behaviour is for git-send-pack
to clean up its environment before it execs or for git-receive-pack to
ignore most GIT variables.

Interposing a short script with env -i or env -uGIT_OBJECT_DIRECTORY is
the easiest workaround.

```

## Junio C Hamano, 2006-01-06 22:36

Subject: Re: local git push bug wrt GIT_OBJECT_DIRECTORY
Message-ID: <7vbqypt245.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vbqypt245.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <1135922900.2103.37.camel@della.draisey.ca>

```
Matt Draisey <matt@draisey.ca> writes:

> Using git-send-pack to push to a local repository will propagate the
> environment variable GIT_OBJECT_DIRECTORY to git-receive-pack.
> git-receive-pack correctly ignores GIT_DIR (as opposed to what the
> documentation says) but, unfortunately, honours GIT_OBJECT_DIRECTORY.

Thanks for noticing.

True; receive-pack does not "ignore", but is explicitly told to
use the other repository by invoking send-pack.  

> It's not clear to me whether the correct behaviour is for git-send-pack
> to clean up its environment before it execs or for git-receive-pack to
> ignore most GIT variables.

Probably GIT_OBJECT_DIRECTORY should not be propagated;
GIT_ALTERNATE_OBJECT_DIRECTORIES neither.

```
