{"thread":{"id":"49148","subject":"git-clone removes destination path after permission deny","startedAt":"2018-08-16T12:08:18Z","lastAt":"2018-08-16T23:43:30Z","messageCount":3,"participants":["Agis","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"355829","messageId":"A1C23FEE-55CC-4888-9BD5-1C4566E83A38@gmail.com","threadId":"49148","inReplyTo":null,"subject":"git-clone removes destination path after permission deny","fromName":"Agis","fromEmail":"agis.anast@gmail.com","sentAt":"2018-08-16T12:08:11Z","receivedAt":"2018-08-16T12:08:18Z","isPatch":false,"sender":{"key":"agis.anast@gmail.com","avatar":null},"body":"Hello.\n\nI've recently observed the following:\n\n    $ mkdir foo\n    $ # try to clone from a repository that you have no access to\n    $ git clone git@github.com:agis/private.git foo\n    Cloning into 'foo'...\n    Permission denied (publickey).\n    fatal: Could not read from remote repository.\n\n    Please make sure you have the correct access rights\n    and the repository exists.\n    $ ls foo\n    ls: cannot access 'foo': No such file or directory\n\nIs this expected behavior?\n\nThanks in advance,\nAgis\n\nP.S. If this is something that should be fixed, I'd be happy to prepare a patch\n\n"},{"id":"355830","messageId":"450A55F6-A4B8-4841-8814-FC7365EFE43E@gmail.com","threadId":"49148","inReplyTo":"A1C23FEE-55CC-4888-9BD5-1C4566E83A38@gmail.com","subject":"Re: git-clone removes destination path after permission deny","fromName":"Agis","fromEmail":"agis.anast@gmail.com","sentAt":"2018-08-16T12:16:20Z","receivedAt":"2018-08-16T12:16:26Z","isPatch":false,"sender":{"key":"agis.anast@gmail.com","avatar":null},"body":"Nevermind, this is does not happen in 2.18.0. Apparently it was fixed somewhere between 2.11 and 2.18.\n\n> On 16 Aug 2018, at 15:08, Agis <agis.anast@gmail.com> wrote:\n> \n> Hello.\n> \n> I've recently observed the following:\n> \n>    $ mkdir foo\n>    $ # try to clone from a repository that you have no access to\n>    $ git clone git@github.com:agis/private.git foo\n>    Cloning into 'foo'...\n>    Permission denied (publickey).\n>    fatal: Could not read from remote repository.\n> \n>    Please make sure you have the correct access rights\n>    and the repository exists.\n>    $ ls foo\n>    ls: cannot access 'foo': No such file or directory\n> \n> Is this expected behavior?\n> \n> Thanks in advance,\n> Agis\n> \n> P.S. If this is something that should be fixed, I'd be happy to prepare a patch\n> \n\n"},{"id":"355889","messageId":"20180816234324.GA66961@aiede.svl.corp.google.com","threadId":"49148","inReplyTo":"450A55F6-A4B8-4841-8814-FC7365EFE43E@gmail.com","subject":"Re: git-clone removes destination path after permission deny","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-08-16T23:43:24Z","receivedAt":"2018-08-16T23:43:30Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nAgis wrote:\n> On 16 Aug 2018, at 15:08, Agis <agis.anast@gmail.com> wrote:\n\n>>    $ mkdir foo\n>>    $ git clone git@github.com:agis/private.git foo\n>>    Cloning into 'foo'...\n>>    Permission denied (publickey).\n>>    fatal: Could not read from remote repository.\n[...]\n>>    $ ls foo\n>>    ls: cannot access 'foo': No such file or directory\n>>\n>> Is this expected behavior?\n[...]\n> Nevermind, this is does not happen in 2.18.0. Apparently it was\n> fixed somewhere between 2.11 and 2.18.\n\nIndeed, this was fixed by v2.16.2~5^2 (clone: do not clean up\ndirectories we didn't create, 2018-01-02).\n\nCc-ing the author of that change (Peff) so he can meet a happy\nuser of it. :)\n\nThanks and hope that helps,\nJonathan\n"}]}