{"thread":{"id":"50686","subject":"Re: git reset error on Windows","startedAt":"2019-03-07T21:25:31Z","lastAt":"2019-03-08T15:42:32Z","messageCount":2,"participants":["Adrian Godong","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"370926","messageId":"CANNTdjSdTiNcM+UzF+2ZH_2JOyDZM0E6RFCDwsT3Y7F=G7YdOA@mail.gmail.com","threadId":"50686","inReplyTo":"CANNTdjSRB+_1Ue6LLxMcAdLmdg5TrihZ4CeZhvnpgwnEP=SQ3A@mail.gmail.com","subject":"Re: git reset error on Windows","fromName":"Adrian Godong","fromEmail":"adrian.godong@gmail.com","sentAt":"2019-03-07T21:24:52Z","receivedAt":"2019-03-07T21:25:31Z","isPatch":false,"sender":{"key":"adrian.godong@gmail.com","avatar":null},"body":"Windows 10, git version 2.21.0.windows.1\n\ngit reset tries to delete folder when last file is removed but failed\nto do so if shell is in the deleted folder.\n\nRepro steps (powershell):\nmkdir test\ncd test\ngit init\nmkdir dir\ncd dir\nadd-content .\\file \"\"\ngit add .\ngit commit -m \"1\"\ngit mv .\\file .\\file2\ngit commit -m \"2\"\ngit reset --hard HEAD^\n> Deletion of directory 'dir' failed. Should I try again? (y/n)\n\nChoosing y will repeat the same prompt. Choosing n will complete the\noperation correctly.\n\n-- \nAdrian Godong\nadrian.godong@gmail.com\n"},{"id":"370992","messageId":"nycvar.QRO.7.76.6.1903081641120.41@tvgsbejvaqbjf.bet","threadId":"50686","inReplyTo":"CANNTdjSdTiNcM+UzF+2ZH_2JOyDZM0E6RFCDwsT3Y7F=G7YdOA@mail.gmail.com","subject":"Re: git reset error on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-03-08T15:42:13Z","receivedAt":"2019-03-08T15:42:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Adrian,\n\nOn Thu, 7 Mar 2019, Adrian Godong wrote:\n\n> Windows 10, git version 2.21.0.windows.1\n> \n> git reset tries to delete folder when last file is removed but failed\n> to do so if shell is in the deleted folder.\n> \n> Repro steps (powershell):\n> mkdir test\n> cd test\n> git init\n> mkdir dir\n> cd dir\n> add-content .\\file \"\"\n> git add .\n> git commit -m \"1\"\n> git mv .\\file .\\file2\n> git commit -m \"2\"\n> git reset --hard HEAD^\n> > Deletion of directory 'dir' failed. Should I try again? (y/n)\n> \n> Choosing y will repeat the same prompt. Choosing n will complete the\n> operation correctly.\n\nIn contrast to Linux, it is not possible to delete a current working\ndirectory (unless you delve into horrible hacks like Cygwin does).\n\nSo this is a restriction of the platform on which you are working, and\nthere is nothing we can do about it, at least as far as I can think of.\n\nCiao,\nJohannes\n"}]}