{"thread":{"id":"28451","subject":"[Bug report] git fetch/push fails from sub-directory","startedAt":"2011-09-20T21:50:04Z","lastAt":"2011-09-20T22:25:13Z","messageCount":3,"participants":["Frederic Heitzmann","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"175898","messageId":"j5b1qa$pki$1@dough.gmane.org","threadId":"28451","inReplyTo":null,"subject":"[Bug report] git fetch/push fails from sub-directory","fromName":"Frederic Heitzmann","fromEmail":"frederic.heitzmann@gmail.com","sentAt":"2011-09-20T21:50:04Z","receivedAt":"2011-09-20T21:50:04Z","isPatch":false,"sender":{"key":"frederic.heitzmann@gmail.com","avatar":null},"body":"Hi,\n\nI found a bug in git fetch, with local repositories.\ngit fetch works fine from the root directory, but it fails when called \nfrom deeper into the file tree of the repository.\n\ngit push fails the same way.\n\nThe bug is on 1.7.7.rc2 and on master.\n\nmkdir repo1\ncd repo1\ngit init .\nmkdir d\ntouch d/f\ngit add d/f\ngit commit -m'initial commit'\ncd ..\ngit clone repo1 repo2\ncd repo2\ngit fetch ../repo1\t# OK\ncd d\ngit fetch ../../repo1\t# failed\n\nfatal: '../../repo1' does not appear to be a git repository\nfatal: The remote end hung up unexpectedly\n\n--\nFred\n"},{"id":"175899","messageId":"7v62km6fjl.fsf@alter.siamese.dyndns.org","threadId":"28451","inReplyTo":"j5b1qa$pki$1@dough.gmane.org","subject":"Re: [Bug report] git fetch/push fails from sub-directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-20T21:59:42Z","receivedAt":"2011-09-20T21:59:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frederic Heitzmann <frederic.heitzmann@gmail.com> writes:\n\n> I found a bug in git fetch, with local repositories.\n\n> cd repo2\n> git fetch ../repo1\t# OK\n> cd d\n> git fetch ../../repo1\t# failed\n\nIt has always been like this.  You can give a full path to the repository\nfrom the root, or perhaps define a nickname to refer to the remote (see\n\"git remote add\") and use it instead.\n"},{"id":"175900","messageId":"4E7912C9.7000908@gmail.com","threadId":"28451","inReplyTo":"7v62km6fjl.fsf@alter.siamese.dyndns.org","subject":"Re: [Bug report] git fetch/push fails from sub-directory","fromName":"Frederic Heitzmann","fromEmail":"frederic.heitzmann@gmail.com","sentAt":"2011-09-20T22:25:13Z","receivedAt":"2011-09-20T22:25:13Z","isPatch":false,"sender":{"key":"frederic.heitzmann@gmail.com","avatar":null},"body":"Le 20/09/2011 23:59, Junio C Hamano a écrit :\n> Frederic Heitzmann<frederic.heitzmann@gmail.com>  writes:\n>\n>> I found a bug in git fetch, with local repositories.\n>\n>> cd repo2\n>> git fetch ../repo1\t# OK\n>> cd d\n>> git fetch ../../repo1\t# failed\n>\n> It has always been like this.  You can give a full path to the repository\n> from the root, or perhaps define a nickname to refer to the remote (see\n> \"git remote add\") and use it instead.\n\nIs it supposed to be normal ?!\nI mean : OK I can use git-remote, but this leads to differents results \nfor similar usages and similar commands.\nLet's compare following cases :\n\n_Case 1:_\n\n|\n|_repo1\n|   |\n|   \\_dir\n|\n\\_repo2\n     |\n     \\_dir\n\n\ncd repo2/dir\ngit fetch ../../repo1\t# FAILURE\n\n_Case 2:_\n\n|\n|_repo1\n|\n\\_temp\n     |\n     \\_repo2\n\ncd temp/repo2\ngit fetch ../../repo1\t# SUCCESS\n\nFor sure, one can argue that I should better organize my file tree ;-)\n\n--\nFred\n"}]}