git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug report] git fetch/push fails from sub-directory
@ 2011-09-20 21:50 Frederic Heitzmann
  2011-09-20 21:59 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Frederic Heitzmann @ 2011-09-20 21:50 UTC (permalink / raw)
  To: git

Hi,

I found a bug in git fetch, with local repositories.
git fetch works fine from the root directory, but it fails when called 
from deeper into the file tree of the repository.

git push fails the same way.

The bug is on 1.7.7.rc2 and on master.

mkdir repo1
cd repo1
git init .
mkdir d
touch d/f
git add d/f
git commit -m'initial commit'
cd ..
git clone repo1 repo2
cd repo2
git fetch ../repo1	# OK
cd d
git fetch ../../repo1	# failed

fatal: '../../repo1' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

--
Fred

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug report] git fetch/push fails from sub-directory
  2011-09-20 21:50 [Bug report] git fetch/push fails from sub-directory Frederic Heitzmann
@ 2011-09-20 21:59 ` Junio C Hamano
  2011-09-20 22:25   ` Frederic Heitzmann
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-09-20 21:59 UTC (permalink / raw)
  To: Frederic Heitzmann; +Cc: git

Frederic Heitzmann <frederic.heitzmann@gmail.com> writes:

> I found a bug in git fetch, with local repositories.

> cd repo2
> git fetch ../repo1	# OK
> cd d
> git fetch ../../repo1	# failed

It has always been like this.  You can give a full path to the repository
from the root, or perhaps define a nickname to refer to the remote (see
"git remote add") and use it instead.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug report] git fetch/push fails from sub-directory
  2011-09-20 21:59 ` Junio C Hamano
@ 2011-09-20 22:25   ` Frederic Heitzmann
  0 siblings, 0 replies; 3+ messages in thread
From: Frederic Heitzmann @ 2011-09-20 22:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Le 20/09/2011 23:59, Junio C Hamano a écrit :
> Frederic Heitzmann<frederic.heitzmann@gmail.com>  writes:
>
>> I found a bug in git fetch, with local repositories.
>
>> cd repo2
>> git fetch ../repo1	# OK
>> cd d
>> git fetch ../../repo1	# failed
>
> It has always been like this.  You can give a full path to the repository
> from the root, or perhaps define a nickname to refer to the remote (see
> "git remote add") and use it instead.

Is it supposed to be normal ?!
I mean : OK I can use git-remote, but this leads to differents results 
for similar usages and similar commands.
Let's compare following cases :

_Case 1:_

|
|_repo1
|   |
|   \_dir
|
\_repo2
     |
     \_dir


cd repo2/dir
git fetch ../../repo1	# FAILURE

_Case 2:_

|
|_repo1
|
\_temp
     |
     \_repo2

cd temp/repo2
git fetch ../../repo1	# SUCCESS

For sure, one can argue that I should better organize my file tree ;-)

--
Fred

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-20 22:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 21:50 [Bug report] git fetch/push fails from sub-directory Frederic Heitzmann
2011-09-20 21:59 ` Junio C Hamano
2011-09-20 22:25   ` Frederic Heitzmann

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).